ci: update the actions #216
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Web Front-end Tests | |
on: | |
push: [] | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- review_requested | |
branches: | |
- master | |
- dev | |
paths: | |
- 'package.json' | |
- '.env.ci' | |
- 'vite.config.ts' | |
- 'svelte.config.js' | |
- 'tsconfig.json' | |
- 'postcss.config.cjs' | |
- 'tailwind.config.cjs' | |
- 'src/**' | |
- '.github/workflows/front-end.yml' | |
jobs: | |
web_front-end_tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x, 20.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Testing on Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Treat .env.ci as the environment for CI | |
run: cp .env.ci .env | |
- name: Cache node modules | |
uses: actions/cache@v4 | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}_${{ matrix.node-version }}_${{ hashFiles('package.json') }} | |
restore-keys: | | |
${{ runner.os }}_${{ matrix.node-version }}_${{ hashFiles('package.json') }} | |
- name: Install general dependencies | |
run: npm install | |
- name: Run the tests | |
run: npm run test:unit |