diff --git a/.github/workflows/build-ci-target.yml b/.github/workflows/build-ci-target.yml deleted file mode 100644 index df531978..00000000 --- a/.github/workflows/build-ci-target.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: PayPay Node SDK Upload CI Results -on: - workflow_run: - workflows: ["Paypay Node SDK CI"] - types: ["completed"] -jobs: - upload-codeclimate: - runs-on: ubuntu-latest - steps: - - name: Clone PR branch - uses: actions/checkout@v2 - with: - ref: ${{ github.event.workflow_run.head_sha }} - - - name: Download codeclimate reporter - run: | - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ../cc-test-reporter && chmod +x ../cc-test-reporter - - name: codeclimate before-build - env: - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID}} - GIT_COMMIT_SHA: ${{ github.event.workflow_run.head_sha }} - GIT_BRANCH: ${{ github.event.workflow_run.head_branch }} - run: | - ../cc-test-reporter before-build - - - name: Download coverage from CI run - uses: actions/github-script@v3.1.0 - with: - script: | - const coverageArtifactName = "lcov-14.x"; - var artifacts = await github.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: ${{github.event.workflow_run.id }}, - }); - var matchArtifact = artifacts.data.artifacts.filter((artifact) => { - return artifact.name == coverageArtifactName; - })[0]; - if (!matchArtifact) { - console.error(artifacts); - throw new Error("did not find expected artifact `" + artifactName + "`"); - } - var download = await github.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: 'zip', - }); - var fs = require('fs'); - fs.writeFileSync('${{github.workspace}}/coverage-artifact.zip', Buffer.from(download.data)); - - run: unzip -j coverage-artifact.zip lcov.info -d coverage - - - name: codeclimate after-build - env: - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID}} - GIT_COMMIT_SHA: ${{ github.event.workflow_run.head_sha }} - GIT_BRANCH: ${{ github.event.workflow_run.head_branch }} - run: ../cc-test-reporter after-build -t lcov --exit-code 0 diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml index 7c10f8e2..7eb2ec0a 100644 --- a/.github/workflows/build-ci.yml +++ b/.github/workflows/build-ci.yml @@ -32,12 +32,13 @@ jobs: - name: Test coverage run: yarn coverage - - name: Upload coverage GitHub artifact - uses: actions/upload-artifact@v2 - with: - # Consumed by the `build-ci-target.yml` `upload-codeclimate` job. - name: lcov-${{ matrix.node-version }} - path: ./coverage/ + - name: Code Climate before-build + env: + CC_TEST_REPORTER_ID: 92148e640143d0b54de61861a2786dd839f2f9b076a9da2769e5f02cd1cbd9eb + run: | + curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter + chmod +x ./cc-test-reporter + ./cc-test-reporter before-build - name: Upload coverall reports uses: coverallsapp/github-action@master @@ -47,3 +48,8 @@ jobs: - name: Upload to CoPilot run: bash <(curl -s https://copilot.blackducksoftware.com/ci/githubactions/scripts/upload) + + - name: Code Climate after-build + env: + CC_TEST_REPORTER_ID: 92148e640143d0b54de61861a2786dd839f2f9b076a9da2769e5f02cd1cbd9eb + run: ./cc-test-reporter after-build --exit-code 0