Skip to content

ci: simplify upload and download artifacts #682

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .github/actions/download-build/action.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 1 addition & 7 deletions .github/actions/download-coverage-report/action.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 1 addition & 7 deletions .github/actions/download-lint-report/action.yml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 3 additions & 6 deletions .github/workflows/basic-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/compatibility-observability.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/sonar-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading