Skip to content

Commit 97620cd

Browse files
committed
Adjust CI.
1 parent ec0b1e9 commit 97620cd

1 file changed

Lines changed: 42 additions & 20 deletions

File tree

.github/workflows/rust.yml

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
name: Rust
1+
name: snmalloc-rs CI
2+
3+
# The following should ensure that the workflow only runs a single set of actions
4+
# for each PR. But it will not apply this to pushes to the main branch.
5+
concurrency:
6+
group: ${{ github.ref }}-rust
7+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
28

39
on:
410
push:
5-
branches: [ master ]
11+
branches: [ main ]
612
pull_request:
7-
branches: [ master ]
13+
branches: [ main ]
14+
15+
workflow_dispatch:
816

917
env:
1018
CARGO_TERM_COLOR: always
@@ -13,37 +21,51 @@ jobs:
1321
build:
1422

1523
runs-on: ${{ matrix.os }}
24+
name: "${{ matrix.os }}-${{ matrix.release.name }}-${{ matrix.rust }} (features: ${{ matrix.features.name }})"
25+
defaults:
26+
run:
27+
shell: bash
28+
working-directory:
29+
./snmalloc-rs
1630
strategy:
1731
matrix:
1832
os: [windows-latest, macos-14, macos-15, ubuntu-latest]
1933
rust: [stable, nightly]
34+
release:
35+
- name: release
36+
flag: "--release"
37+
- name: debug
38+
flag: ""
39+
features:
40+
- name: default
41+
args: ""
42+
- name: debug
43+
args: "--features debug"
44+
- name: check
45+
args: "--features check"
46+
- name: build_cc
47+
args: '--features "build_cc usecxx17"'
48+
- name: native-cpu
49+
args: "--features native-cpu"
50+
- name: local_dynamic_tls
51+
args: "--features local_dynamic_tls"
52+
- name: lto
53+
args: "--features lto"
54+
# Don't abort runners if a single one fails
55+
fail-fast: false
2056
steps:
2157
- uses: actions-rs/toolchain@v1
2258
with:
2359
toolchain: ${{ matrix.rust }}
2460
- name: Checkout
25-
uses: actions/checkout@v2
26-
with:
27-
submodules: recursive
61+
uses: actions/checkout@v4
2862
- name: update dependency
2963
run: |
3064
if bash -c 'uname -s | grep 'Linux' >/dev/null'; then
3165
sudo apt-get update -y && sudo apt-get --reinstall install -y libc6-dev
3266
fi
3367
shell: bash
3468
- name: Build
35-
run: cargo build --verbose
69+
run: cargo build ${{ matrix.release.flag }} --verbose ${{ matrix.features.args }}
3670
- name: Run tests
37-
run: cargo test --all
38-
- name: Run tests debug
39-
run: cargo test --all --features debug
40-
- name: Run tests check
41-
run: cargo test --all --features check
42-
- name: Run tests build_cc
43-
run: cargo test --all --features "build_cc usecxx17"
44-
- name: Run tests native-cpu
45-
run: cargo test --all --features native-cpu
46-
- name: Run tests local_dynamic_tls
47-
run: cargo test --all --features local_dynamic_tls
48-
- name: Run tests lto
49-
run: cargo test --all --features lto
71+
run: cargo test ${{ matrix.release.flag }} --all ${{ matrix.features.args }}

0 commit comments

Comments
 (0)