forked from rust-diplomat/diplomat
-
Notifications
You must be signed in to change notification settings - Fork 0
180 lines (140 loc) · 3.59 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
name: Diplomat CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check rustfmt
run: cargo fmt --all -- --check
- name: Check clippy
run: cargo clippy --all-targets --all-features -- -D warnings
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
gen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install cargo-make
uses: taiki-e/install-action@v2
with:
tool: [email protected] # https://github.com/rust-diplomat/diplomat/issues/440
- name: Run regeneration
run: cargo make gen
- name: Test code is fresh
run: git add . && git diff --cached --exit-code
test-c:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install cargo-make
uses: taiki-e/install-action@cargo-make
- name: Test C
run: cargo make test-c
check-c:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install cargo-make
uses: taiki-e/install-action@cargo-make
- name: clang, c11
run: cargo make check-c
env:
CC: clang
C_STD: c11
- name: gcc, c11
run: cargo make check-c
env:
CC: gcc
C_STD: c11
- name: gcc, c2x
run: cargo make check-c
env:
CC: gcc
C_STD: c2x
test-cpp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install cargo-make
uses: taiki-e/install-action@cargo-make
- name: clang
run: CXX=clang++-14 cargo make test-cpp
- name: gcc
run: CXX=g++ cargo make test-cpp
check-cpp:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install cargo-make
uses: taiki-e/install-action@cargo-make
- name: clang, c++17
run: cargo make check-cpp
env:
CXX: clang
CXX_STD: c++17
- name: clang, c++20
run: cargo make check-cpp
env:
CXX: clang
CXX_STD: c++20
- name: gcc, c++23
if: ${{ matrix.os != 'macos-latest' }}
run: cargo make check-cpp
env:
CXX: gcc
CXX_STD: c++23
test-js:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [
18.20.3, # supported until 2025-04-30
20.14.0, # supported until 2026-04-30
22.3.0, # current, supported until 2027-04-30
]
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Install cargo-make
uses: taiki-e/install-action@cargo-make
- name: Load Rust toolchain for WASM.
run: rustup target add wasm32-unknown-unknown
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Test JS
run: cargo make test-js
test-dart:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install cargo-make
uses: taiki-e/install-action@cargo-make
- name: Install Dart
uses: dart-lang/setup-dart@v1
with:
sdk: 3.4.0-204.0.dev
- name: Test Dart
run: cargo make test-dart