-
Notifications
You must be signed in to change notification settings - Fork 6
99 lines (88 loc) · 2.71 KB
/
ci.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
95
96
97
98
99
# Github actions workflow name
name: CI
env: {NODE_VERSION: 20}
# Triggers the workflow on push or pull request events
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
windows_test:
name: Test eslint-plugin-wxml on windows with node20
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with: {node-version: '${{ env.NODE_VERSION }}'}
- run: npm install
- run: npm run lint
- run: npm run test
macos_test:
name: Test eslint-plugin-wxml on macos with node20
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with: {node-version: '${{ env.NODE_VERSION }}'}
- run: npm install
- run: npm run lint
- run: npm run test
eslint9_test:
name: Test eslint-plugin-wxml with eslint9
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with: {node-version: '${{ env.NODE_VERSION }}'}
- run: npm install
- run: npm install eslint@9
- run: npm run lint
- run: npm run test
eslint8_test:
name: Test eslint-plugin-wxml with eslint8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with: {node-version: '${{ env.NODE_VERSION }}'}
- run: npm install
- run: npm install eslint@8
- run: npm run lint
- run: npm run test
node_tests:
name: 'Test eslint-plugin-wxml on ${{matrix.os}} with node${{matrix.node}}'
strategy:
matrix:
os: [ubuntu-latest]
node: [12, 14, 16, 18, 21]
runs-on: ${{ matrix.os }}
steps:
# Pull repo to test machine
- uses: actions/checkout@v3
# Configures the node version used on GitHub-hosted runners
- uses: actions/setup-node@v3
with:
# The Node.js version to configure
node-version: ${{ matrix.node }}
# Caching dependencies to speed up workflows
- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v3
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install npm dependencies
run: npm install
- name: Print put node & npm version
# Output useful info for debugging.
run: node --version && npm --version
- name: ESlint Lint
run: npm run lint
- name: Run Test
run: npm run test