-
Notifications
You must be signed in to change notification settings - Fork 21
79 lines (74 loc) · 2.37 KB
/
Copy pathtesting.yml
File metadata and controls
79 lines (74 loc) · 2.37 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Testing
# Packaging will take care of testing on pushes to the main branch, so we don't need it in this workflow.
on:
pull_request:
branches:
- main
- "**"
jobs:
dependencies:
name: Dependencies
if: "!contains(github.event.commits[0].message, '[skip ci]')"
runs-on: windows-latest
strategy:
matrix:
node: ["16.17.0"]
npm: ["8.15.0"]
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.0
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
- name: Setup Node.js 16.x
uses: actions/setup-node@v4
with:
node-version: 16.x
cache: "npm"
- name: Retrieve cached dependencies
uses: actions/cache@v3
id: npm-cache
with:
path: |
node_modules
key: ${{ runner.os }}-windows-latest-${{ matrix.npm }}-${{ matrix.node }}-${{ hashFiles('package-lock.json') }}
- name: Install dependencies' dependencies
run: |
pushd ..
npm install node-gyp
npm install autogypi
popd
- name: Install all dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
test:
name: Tests
needs: [dependencies]
if: "!contains(github.event.commits[0].message, '[skip ci]')"
runs-on: windows-latest
strategy:
matrix:
node: ["16.17.0"]
npm: ["8.15.0"]
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.0
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
- uses: actions/setup-node@v4
with:
node-version: 16.x
cache: "npm"
- name: Retrieve cached dependencies
uses: actions/cache@v3
id: npm-cache
with:
path: |
node_modules
key: ${{ runner.os }}-windows-latest-${{ matrix.npm }}-${{ matrix.node }}-${{ hashFiles('package-lock.json') }}
# - run: npm install
- name: Run The Tests
run: npm run test