Skip to content
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

ci: modernize artifact action #1178

Merged
merged 4 commits into from
May 2, 2024
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
28 changes: 15 additions & 13 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
- cron: '42 23 * * 5'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: '${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true

env:
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
run: npm run build
- name: artifact build result
# see https://github.com/actions/upload-artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.DIST_DIR }}
path: ${{ env.DIST_DIR }}
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
npm i --ignore-scripts --loglevel=silly --no-save $dev_requirements
- name: fetch build artifact
# see https://github.com/actions/download-artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ env.DIST_DIR }}
path: ${{ env.DIST_DIR }}
Expand All @@ -143,21 +143,21 @@ jobs:
--coverage
--coverageDirectory='${{ env.REPORTS_DIR }}/node${{ matrix.node-version }}_${{ matrix.os }}/coverage'
env:
JEST_JUNIT_OUTPUT_DIR: ${{ env.REPORTS_DIR }}/node${{ matrix.node-version }}_${{ matrix.os }}
JEST_JUNIT_OUTPUT_DIR: '${{ env.REPORTS_DIR }}/node${{ matrix.node-version }}_${{ matrix.os }}'
- name: artifact test logs
if: ${{ failure() }}
# see https://github.com/actions/upload-artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: logs-jest_node${{ matrix.node-version }}-${{ matrix.os }}
name: logs-jest_node${{ matrix.node-version }}_${{ matrix.os }}
path: tests/_log
if-no-files-found: error
- name: artifact test reports
if: ${{ ! cancelled() }}
# see https://github.com/actions/upload-artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.TESTS_REPORTS_ARTIFACT }}
name: '${{ env.TESTS_REPORTS_ARTIFACT }}_node${{ matrix.node-version }}_${{ matrix.os }}'
path: ${{ env.REPORTS_DIR }}
if-no-files-found: error

Expand Down Expand Up @@ -212,7 +212,7 @@ jobs:
npm rebuild --loglevel=silly libxmljs2 || npm uninstall --no-save libxmljs2
- name: fetch build artifact
# see https://github.com/actions/download-artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ env.DIST_DIR }}
path: ${{ env.DIST_DIR }}
Expand All @@ -227,7 +227,7 @@ jobs:
- name: artifact test reports
if: ${{ failure() }}
# see https://github.com/actions/upload-artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dogfooding-direct_npm${{ matrix.npm-version }}
path: ${{ env.REPORTS_DIR }}
Expand All @@ -242,14 +242,16 @@ jobs:
steps:
- name: fetch test artifacts
# see https://github.com/actions/download-artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ env.TESTS_REPORTS_ARTIFACT }}
pattern: '${{ env.TESTS_REPORTS_ARTIFACT }}_*'
merge-multiple: true
path: ${{ env.REPORTS_DIR }}
- name: Run codacy-coverage-reporter
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
if: ${{ env.CODACY_PROJECT_TOKEN != '' }} ## see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-secrets
## see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-secrets
if: ${{ env.CODACY_PROJECT_TOKEN != '' }}
# see https://github.com/codacy/codacy-coverage-reporter-action
uses: codacy/codacy-coverage-reporter-action@v1
with:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/npm-ls_demo-results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:

jobs:
demo-results:
name: ${{ matrix.subject }} npm${{ matrix.npm-version }} node${{ matrix.node-version }} ${{ matrix.os }}
name: '${{ matrix.subject }} npm${{ matrix.npm-version }} node${{ matrix.node-version }} ${{ matrix.os }}'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # gather all the results !
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
run: |
mkdir -p '${{ env.RESULTS_DIR }}'
echo 'OUT_FILE_PREFIX=${{ env.RESULTS_DIR }}/npm-ls_npm${{ matrix.npm-version }}_node${{ matrix.node-version }}_${{ matrix.os }}' >> $GITHUB_ENV
working-directory: ${{ env.DEMO_ROOT_DIR}}/${{ matrix.subject }}
working-directory: '${{ env.DEMO_ROOT_DIR}}/${{ matrix.subject }}'
shell: bash # don't want to write tht code twice, windows and unix-like
- name: Setup Node.js ${{ matrix.node-version }}
# see https://github.com/actions/setup-node
Expand All @@ -97,11 +97,11 @@ jobs:
ls --json --all --long
2> ${{ env.OUT_FILE_PREFIX }}.err.log
1> ${{ env.OUT_FILE_PREFIX }}.json
working-directory: ${{ env.DEMO_ROOT_DIR}}/${{ matrix.subject }}
working-directory: '${{ env.DEMO_ROOT_DIR}}/${{ matrix.subject }}'
- name: Artifact RESULTS
# see https://github.com/actions/upload-artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.RESULTS_ARTIFACT }}
path: ${{ env.DEMO_ROOT_DIR}}/*/${{ env.RESULTS_DIR }}
name: '${{ env.RESULTS_ARTIFACT }}_${{ matrix.subject }}_npm${{ matrix.npm-version }}_node${{ matrix.node-version }}_${{ matrix.os }}'
path: '${{ env.DEMO_ROOT_DIR}}/*/${{ env.RESULTS_DIR }}'
if-no-files-found: error
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
npm pack --pack-destination "$PACKED_DIR"
- name: artifact release result
# see https://github.com/actions/upload-artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.PACKED_ARTIFACT }}
path: ${{ env.PACKED_DIR }}/
Expand All @@ -130,7 +130,7 @@ jobs:
steps:
- name: fetch release result
# see https://github.com/actions/download-artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ env.PACKED_ARTIFACT }}
path: ${{ env.ASSETS_DIR }}
Expand Down
Loading