generated from KennethTrecy/web_template
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (47 loc) · 1.22 KB
/
front-end.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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