From: WonYoung Choi Date: Fri, 24 Jul 2020 08:08:46 +0000 (+0900) Subject: [Build] Use github actions for building and reporting annotations (#1859) X-Git-Tag: accepted/tizen/unified/20210219.040944~537 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=74e954da4e2dba07bdbfc2989d5152eb8ae16d89;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [Build] Use github actions for building and reporting annotations (#1859) --- diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml index 03186ba..bef0a2d 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/pull_request.yaml @@ -6,44 +6,7 @@ on: - master - API* -env: - LATEST_LEVEL: API8 - jobs: - check-api-level: - runs-on: ubuntu-latest - outputs: - level: ${{ steps.get-level.outputs.level }} - steps: - - name: Get API Level - id: get-level - run: | - getLevel() { - if [[ $GITHUB_BASE_REF == master ]]; then - echo $LATEST_LEVEL - elif [[ $GITHUB_BASE_REF =~ ^API[0-9]+$ ]]; then - echo $GITHUB_BASE_REF - fi - } - echo "::set-output name=level::$(getLevel)" - - - name: Add Label for API Level - uses: actions/github-script@v2 - id: add-label - if: ${{ steps.get-level.outputs.level }} - env: - API_LEVEL: ${{ steps.get-level.outputs.level }} - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - result-encoding: string - script: | - github.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: [process.env.API_LEVEL] - }) - build: runs-on: ubuntu-latest steps: @@ -65,60 +28,3 @@ jobs: with: run: ./build.sh full /p:BuildWithAnalyzer=True files: ${{ steps.getChangedFiles.outputs.all }} - - - name: Report Errors - uses: actions/github-script@v2 - if: ${{ failure() && steps.build.outputs.errors }} - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - var errors = ${{ steps.build.outputs.errors }} - var errorsStr = errors.join('\n').replace(new RegExp('${{ github.workspace }}/', 'g'), '') - github.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: '## Build Error:\n```' + errorsStr + '```' - }) - - - name: Pack - run: ./build.sh pack 1.0.0-testing - - - uses: actions/upload-artifact@v2 - with: - name: Artifacts - path: Artifacts/** - - check-api: - needs: [check-api-level, build] - runs-on: ubuntu-latest - if: ${{ needs.check-api-level.outputs.level }} - steps: - - uses: actions/checkout@v2 - with: - repository: TizenAPI/APITool - - - name: Setup .NET Core - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 3.1.x - - - uses: actions/download-artifact@v2 - with: - name: Artifacts - path: Artifacts - - - name: Extract API - run: | - dotnet run print --format=json --include-hidden -o api.json Artifacts/bin/public/ - - - name: Compare with APIDB - uses: TizenAPI/tizenfx-build-actions/apidb@v1 - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - with: - token: ${{ secrets.GITHUB_TOKEN }} - operation: compare - category: ${{ needs.check-api-level.outputs.level }} - path: api.json