Skip to content

chore(deps): bump actions/download-artifact from 3 to 4 #680

chore(deps): bump actions/download-artifact from 3 to 4

chore(deps): bump actions/download-artifact from 3 to 4 #680

Workflow file for this run

name: Node.js CI
on: [push, pull_request]
jobs:
install:
runs-on: ubuntu-latest
timeout-minutes: 5
env:
CI: true
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Volta Node/NPM
uses: volta-cli/action@v1
- name: Get cache dir, Node Version and NPM Version
id: node-config
run: |
echo "::set-output name=nodev::$(node -v)"
echo "::set-output name=npmv::$(npm -v)"
echo "::set-output name=dir::$(npm config get cache)"
- name: Cache npm cache
uses: actions/cache@v3
with:
path: ${{ steps.node-config.outputs.dir }}
key: npm-${{ runner.os }}-node-${{ steps.node-config.outputs.nodev }}-npm-v${{ steps.node-config.outputs.npmv }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
npm-${{ runner.os }}-node-${{ steps.node-config.outputs.nodev }}-npm-v${{ steps.node-config.outputs.npmv }}
npm-${{ runner.os }}-node-${{ steps.node-config.outputs.nodev }}
npm-${{ runner.os }}
- name: Install
run: npm ci
- name: "[node-modules-archive] Pack"
run: tar --exclude *.log -czf node-modules-archive.tar node_modules/
- name: "[node-modules-archive] Upload"
uses: actions/upload-artifact@v3
with:
retention-days: 1
name: node-modules-archive
path: node-modules-archive.tar
lint:
needs: install
runs-on: ubuntu-latest
timeout-minutes: 5
env:
CI: true
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Volta Node/NPM
uses: volta-cli/action@v1
- name: "[node-modules-archive] Download"
uses: actions/download-artifact@v4
with:
name: node-modules-archive
- name: "[node-modules-archive] Unpack"
run: tar -xzf node-modules-archive.tar
- name: Check Linting
run: npm run lint
test-with-codecov:
needs: install
runs-on: ubuntu-latest
timeout-minutes: 5
env:
CI: true
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Volta Node/NPM
uses: volta-cli/action@v1
- name: "[node-modules-archive] Download"
uses: actions/download-artifact@v4
with:
name: node-modules-archive
- name: "[node-modules-archive] Unpack"
run: tar -xzf node-modules-archive.tar
- name: Run Tests
run: npm test -- --coverage
- name: Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
build:
needs: install
runs-on: ubuntu-latest
timeout-minutes: 5
env:
CI: true
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Volta Node/NPM
uses: volta-cli/action@v1
- name: "[node-modules-archive] Download"
uses: actions/download-artifact@v4
with:
name: node-modules-archive
- name: "[node-modules-archive] Unpack"
run: tar -xzf node-modules-archive.tar
- name: Build
run: npm run build
- name: "[dist] Upload"
uses: actions/upload-artifact@v3
with:
retention-days: 1
name: dist
path: |
dist/
dist.module/
bundlewatch:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 5
env:
CI: true
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Volta Node/NPM
uses: volta-cli/action@v1
- name: "[node-modules-archive] Download"
uses: actions/download-artifact@v4
with:
name: node-modules-archive
- name: "[node-modules-archive] Unpack"
run: tar -xzf node-modules-archive.tar
- name: "[dist] Download"
uses: actions/download-artifact@v4
with:
name: dist
- name: Check and Report Bundlesize
run: npx bundlewatch
env:
BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
test:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 5
env:
CI: true
strategy:
fail-fast: false
matrix:
node-version: [18.x, 20.x, 21.x, 22.x, latest]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: volta-cli/action@v1
with:
node-version: ${{ matrix.node-version }}
npm-version: "bundled"
- name: "[node-modules-archive] Download"
uses: actions/download-artifact@v4
with:
name: node-modules-archive
- name: "[node-modules-archive] Unpack"
run: tar -xzf node-modules-archive.tar
- name: "[dist] Download"
uses: actions/download-artifact@v4
with:
name: dist
- name: Run Tests
run: npm run test-dist
cleanup:
needs: [lint, test-with-codecov, bundlewatch, test]
runs-on: ubuntu-latest
timeout-minutes: 5
env:
CI: true
steps:
- name: Cleanup artifacts
uses: geekyeggo/delete-artifact@v1
with:
name: |
dist
node-modules-archive