-
Notifications
You must be signed in to change notification settings - Fork 44
96 lines (90 loc) · 2.53 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
name: CI
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
on:
merge_group:
pull_request:
branches: [ master ]
workflow_dispatch:
inputs:
verbose:
description: "Set --verbose to get verbose build output"
required: false
default: ""
jobs:
rustfmt:
name: Rustfmt (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
rust: [stable]
steps:
- uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: check fmt
run: make check-fmt RUSTV=${{ matrix.rust }}
clippy:
name: Clippy (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
rust: [stable]
steps:
- uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: check clippy
run: make check-clippy
test:
name: Smoke test (${{ matrix.os }}, ${{ matrix.node-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# os: [ubuntu-latest, windows-latest, macOS-latest]
os: [ubuntu-latest, macOS-13]
rust: [stable]
node-version: [ '16', '18', '20' ]
steps:
- uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}
- name: Install nj-cli build
run: cargo install --path nj-cli
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: All Tests
run: make test-all
done:
name: Done
needs: [rustfmt, clippy, test]
runs-on: ubuntu-latest
if: always()
steps:
- name: Dump needs context
env:
CONTEXT: ${{ toJson(needs) }}
run: |
echo -e "\033[33;1;4mDump context\033[0m"
echo -e "$CONTEXT\n"
- name: Report failure on cancellation
if: ${{ contains(needs.*.result, 'cancelled') || cancelled() }}
run: exit 1
- name: Failing test and build
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1
- name: Don't allow skipped
if: ${{ contains(needs.*.result, 'skipped') && github.event_name == 'merge_group' }}
run: exit 1
- name: Successful test and build
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0