Skip to content

Commit

Permalink
fix(actions): imrpove actions artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudio Pennati committed Sep 26, 2024
1 parent 1047b11 commit 2f59a2d
Showing 1 changed file with 35 additions and 26 deletions.
61 changes: 35 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,33 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Upload node_modules cache
uses: actions/cache@v3
- name: Upload modules as artifact
uses: actions/upload-artifact@v4
with:
name: node_modules-${{ matrix.node-version }}
path: node_modules
key: node-modules-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }}

- name: Upload code as artifact
uses: actions/upload-artifact@v3
with:
name: code-${{ matrix.node-version }}
path: .

lint:
name: Lint Code
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x, 20.x, 18.x]
steps:
- name: Download code from artifact
uses: actions/download-artifact@v3
with:
name: code-22.x
path: .
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 22.x
node-version: ${{ matrix.node-version }}

- name: Download modules from artifact
uses: actions/download-artifact@v4
with:
name: node_modules-${{ matrix.node-version }}
path: node_modules

- name: Lint
run: npm run lint
Expand All @@ -61,17 +61,23 @@ jobs:
name: Run unit tests
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x, 20.x, 18.x]
steps:
- name: Download code from artifact
uses: actions/download-artifact@v3
with:
name: code-22.x
path: .
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 22.x
node-version: ${{ matrix.node-version }}

- name: Download modules from artifact
uses: actions/download-artifact@v4
with:
name: node_modules-${{ matrix.node-version }}
path: node_modules

- name: Test
run: npm run test:unit
Expand All @@ -97,17 +103,20 @@ jobs:
mariadb1004,
]
steps:
- name: Download code from artifact
uses: actions/download-artifact@v3
with:
name: code-22.x
path: .
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 22.x

- name: Download modules from artifact
uses: actions/download-artifact@v4
with:
name: node_modules-22.x
path: node_modules

- name: Start Database(s)
run: |
docker-compose \
Expand Down

0 comments on commit 2f59a2d

Please sign in to comment.