-
Notifications
You must be signed in to change notification settings - Fork 4
57 lines (51 loc) · 1.62 KB
/
main.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
50
51
52
53
54
55
56
57
# GitHub Actions
# https://help.github.com/en/articles/configuring-a-workflow
name: Unit test
on: push
jobs:
dependencies:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
# install a specific version of Node using
# https://github.com/actions/setup-node
- name: Use Node.js v18
uses: actions/setup-node@v3
with:
node-version: 18
# just so we learn about available environment variables GitHub provides
- name: Print env variables
run: |
npm i -g @bahmutov/print-env
print-env GITHUB
- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: |
./node_modules
/home/runner/.cache/Cypress
./packages/test-mithril-hooks/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm ci --ignore-scripts
./node_modules/cypress/bin/cypress install
test_mithril_hooks:
runs-on: ubuntu-20.04
needs: dependencies
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/cache@v3
id: npm-cache
with:
path: |
./node_modules
/home/runner/.cache/Cypress
./packages/test-mithril-hooks/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
- name: mithril-hooks test
working-directory: ./packages/test-mithril-hooks
run: npm run test