-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (71 loc) · 2.05 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
name: CI
on:
push:
branches-ignore:
# Dependabot always opens a PR so no need to trigger this twice
- 'dependabot/**'
pull_request:
env:
CI: true
jobs:
pre_job:
name: Check for unecessary runs
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/[email protected]
with:
cancel_others: 'true'
concurrent_skipping: 'true'
skip_after_successful_duplicate: 'true'
paths_ignore: '["**/README.md"]'
do_not_skip: '["pull_request"]'
build-and-test:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
os:
- macos-latest
- ubuntu-latest
- windows-latest
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
- run: npm install --no-fund
- run: npm test
- name: Run tests for ESM
run: npm run test:esm
eslint:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Use Node.js 16
uses: actions/[email protected]
with:
node-version: 16
- run: npm install --no-audit --ignore-scripts --no-fund
- run: npm run lint
clang-format:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Install clang-format
run: sudo apt-get install clang-format
- name: Check style
run: clang-format --style=Google --Werror --dry-run src/zopflipng.cc