-
Notifications
You must be signed in to change notification settings - Fork 22
73 lines (64 loc) · 2.43 KB
/
Copy pathTestPWTCommands.yml
File metadata and controls
73 lines (64 loc) · 2.43 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
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/generator-widget/*'
- 'packages/pluggable-widgets-tools/*'
tests:
- 'packages/command-tests/*'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Defining cache"
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
env:
cache-name: cache-node-modules
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ matrix.node }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- name: Setup pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda #v4.1.0
if: matrix.node == 16
with:
version: 8
- name: Setup pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda #v4.1.0
if: matrix.node == 18
with:
version: 10
- name: "Defining node version"
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: ${{ matrix.node == 18 && '18.15.0' || matrix.node }}
cache: 'pnpm'
- name: "Installing dependencies"
if: steps.filter.outputs.packages == 'true' || steps.filter.outputs.tests == 'true'
run: pnpm 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: ./packages/command-tests
if: steps.filter.outputs.packages == 'true' || steps.filter.outputs.tests == 'true'
run: pnpm test