-
Notifications
You must be signed in to change notification settings - Fork 10
61 lines (53 loc) · 2 KB
/
TestPWTCommands.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
58
59
60
61
name: Script tests
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
test:
name: "Script tests (Node ${{ matrix.node }}, ${{ matrix.os }})"
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: [16, 18]
os: [windows-latest, ubuntu-latest]
steps:
- name: "Checking-out code"
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
with:
submodules: false
- name: "Checking changed files"
id: filter
uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
if: github.event_name == 'pull_request'
with:
filters: |
packages:
- 'packages/**/*'
tests:
- 'tests/**/*'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Defining cache"
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed # v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-${{ matrix.node }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- name: "Defining node version"
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561 # v2
with:
node-version: ${{ matrix.node == 18 && '18.15.0' || matrix.node }}
- name: "Installing dependencies"
working-directory: ./
if: steps.filter.outputs.packages == 'true' || steps.filter.outputs.tests == 'true'
run: npm install
- name: Increase number of watchers
if: (steps.filter.outputs.packages == 'true' || steps.filter.outputs.tests == 'true') && startsWith(matrix.os, 'ubuntu')
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- name: "Testing PWT commands"
working-directory: ./
if: steps.filter.outputs.packages == 'true' || steps.filter.outputs.tests == 'true'
run: npm run test:pwt:commands