-
-
Notifications
You must be signed in to change notification settings - Fork 31
94 lines (78 loc) · 2.65 KB
/
testing.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Testing
on:
push:
branches:
- main
- v1.*
pull_request:
branches:
- '**'
env:
CI: true
jobs:
test:
name: Test for Stylelint ${{ matrix.stylelint }} on Node.js ${{ matrix.node-version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node-version: [18]
os: [ubuntu-latest, macos-latest]
stylelint: [14, 15]
include:
- stylelint: 15
node-version: 14 # For some reason jest-runner-vscode doesn't work well with Node v18 and Windows.
os: windows-latest
- stylelint: 14
node-version: 14 # For some reason jest-runner-vscode doesn't work well with Node v18 and Windows.
os: windows-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: Cache npm cache
uses: actions/cache@v2
id: npm-cache
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install latest npm
run: npm install --global [email protected]
# TODO: [email protected] is broken on Windows. See https://github.com/npm/cli/issues/4341
# run: npm install --global npm@latest
- name: Install dependencies
run: npm ci
- name: Install stylelint v15
run: npm i -D stylelint@^15
if: matrix.stylelint == 15
- name: Install stylelint v14
run: npm i -D stylelint@^14 stylelint-scss@^4.3.0
if: matrix.stylelint == 14
- name: Cache VS Code binaries
uses: actions/cache@v2
id: vscode-cache
with:
path: .vscode-test
key: ${{ runner.os }}-vscode-${{ hashFiles('test/e2e/jest-runner-vscode.config.js') }}
restore-keys: |
${{ runner.os }}-vscode-
- name: Download VS Code
run: npm run download-vscode
- name: Run unit tests
run: npm run test:unit -- --coverage
- name: Run integration tests
run: npm run test:integration -- --coverage
- name: Run end-to-end tests (Linux)
if: runner.os == 'Linux'
run: xvfb-run -a npm run test:e2e -- --silent
- name: Run end-to-end tests (non-Linux)
if: runner.os != 'Linux'
run: npm run test:e2e -- --silent