From 98ce4abb562a4b293107acc39b9c094dca97e4a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Juli=C3=A3o?= Date: Sun, 12 Jan 2025 01:37:27 -0500 Subject: [PATCH] ci: simplify upload and download artifacts (#682) --- .github/actions/download-build/action.yml | 8 +------- .github/actions/download-coverage-report/action.yml | 8 +------- .github/actions/download-lint-report/action.yml | 8 +------- .github/workflows/basic-test.yml | 9 +++------ .github/workflows/compatibility-observability.yml | 2 +- .github/workflows/sonar-pr.yml | 8 ++++---- 6 files changed, 11 insertions(+), 32 deletions(-) diff --git a/.github/actions/download-build/action.yml b/.github/actions/download-build/action.yml index b02e8948..fa51db23 100644 --- a/.github/actions/download-build/action.yml +++ b/.github/actions/download-build/action.yml @@ -1,17 +1,11 @@ name: Download Builds description: Downloading the github artifact created with the build (dist folder) -inputs: - sha: - description: 'SHA to use for the artifact name' - required: false - default: ${{ github.sha }} - runs: using: composite steps: - name: Download dist folder uses: actions/download-artifact@v4 with: - name: library-dist-${{ inputs.sha }} + name: library-dist path: dist diff --git a/.github/actions/download-coverage-report/action.yml b/.github/actions/download-coverage-report/action.yml index 49b00996..b840beaf 100644 --- a/.github/actions/download-coverage-report/action.yml +++ b/.github/actions/download-coverage-report/action.yml @@ -1,17 +1,11 @@ name: Download Coverage Reports description: Download the github artifact created with the `test --coverage` -inputs: - sha: - description: 'SHA to use for the artifact name' - required: false - default: ${{ github.sha }} - runs: using: composite steps: - name: Download coverage report uses: actions/download-artifact@v4 with: - name: ngx-deploy-npm-coverage-report-${{ inputs.sha }} + name: ngx-deploy-npm-coverage-report path: coverage/packages/ngx-deploy-npm diff --git a/.github/actions/download-lint-report/action.yml b/.github/actions/download-lint-report/action.yml index c0419029..41c8a435 100644 --- a/.github/actions/download-lint-report/action.yml +++ b/.github/actions/download-lint-report/action.yml @@ -1,17 +1,11 @@ name: Download Lint Reports description: Download the github artifact with the lint report -inputs: - sha: - description: 'SHA to use for the artifact name' - required: false - default: ${{ github.sha }} - runs: using: composite steps: - name: Download lint report uses: actions/download-artifact@v4 with: - name: lint-report-${{ inputs.sha }} + name: lint-report path: reports diff --git a/.github/workflows/basic-test.yml b/.github/workflows/basic-test.yml index b10162e2..e4a6ad60 100644 --- a/.github/workflows/basic-test.yml +++ b/.github/workflows/basic-test.yml @@ -2,9 +2,6 @@ name: Essential Test on: workflow_call -env: - COMMIT_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} - jobs: lint: runs-on: ubuntu-latest @@ -21,7 +18,7 @@ jobs: - name: Archive lint report results uses: actions/upload-artifact@v4 with: - name: lint-report-${{ env.COMMIT_SHA }} + name: lint-report path: reports build: @@ -35,7 +32,7 @@ jobs: - name: Archive build result uses: actions/upload-artifact@v4 with: - name: library-dist-${{ env.COMMIT_SHA }} + name: library-dist path: dist unit-test: @@ -65,5 +62,5 @@ jobs: name: Archive coverage report uses: actions/upload-artifact@v4 with: - name: ngx-deploy-npm-coverage-report-${{ env.COMMIT_SHA }} + name: ngx-deploy-npm-coverage-report path: coverage/packages/ngx-deploy-npm/lcov.info diff --git a/.github/workflows/compatibility-observability.yml b/.github/workflows/compatibility-observability.yml index 2838ba4d..9682157a 100644 --- a/.github/workflows/compatibility-observability.yml +++ b/.github/workflows/compatibility-observability.yml @@ -16,7 +16,7 @@ jobs: - name: Archive build result uses: actions/upload-artifact@v4 with: - name: library-dist-${{ github.sha }} + name: library-dist path: dist backwards-compatibility-test: diff --git a/.github/workflows/sonar-pr.yml b/.github/workflows/sonar-pr.yml index 7ce7d4b2..afdc496c 100644 --- a/.github/workflows/sonar-pr.yml +++ b/.github/workflows/sonar-pr.yml @@ -75,19 +75,19 @@ jobs: // Download both artifacts await Promise.all([ - downloadArtifact(`ngx-deploy-npm-coverage-report-${sha}`), - downloadArtifact(`lint-report-${sha}`) + downloadArtifact('ngx-deploy-npm-coverage-report'), + downloadArtifact('lint-report') ]); - name: 'Extract reports' run: | # Extract coverage report mkdir -p coverage/packages/ngx-deploy-npm - unzip ngx-deploy-npm-coverage-report-*.zip -d coverage/packages/ngx-deploy-npm + unzip ngx-deploy-npm-coverage-report.zip -d coverage/packages/ngx-deploy-npm # Extract lint report mkdir -p reports - unzip lint-report-*.zip -d reports + unzip lint-report.zip -d reports - name: SonarCloud Scan uses: sonarsource/sonarcloud-github-action@master