Skip to content

Commit 754478b

Browse files
authored
Merge pull request #118 from jonhoo/ci-bump
Ci bump
2 parents a0b2186 + f972d8e commit 754478b

File tree

5 files changed

+82
-88
lines changed

5 files changed

+82
-88
lines changed

.github/workflows/check.yml

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,40 @@
1+
permissions:
2+
contents: read
13
on:
24
push:
35
branches: [main]
46
pull_request:
7+
# Spend CI time only on latest ref: https://github.com/jonhoo/rust-ci-conf/pull/5
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
10+
cancel-in-progress: true
511
name: check
612
jobs:
713
fmt:
814
runs-on: ubuntu-latest
915
name: stable / fmt
1016
steps:
11-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1218
with:
1319
submodules: true
1420
- name: Install stable
1521
uses: dtolnay/rust-toolchain@stable
1622
with:
1723
components: rustfmt
1824
- name: cargo fmt --check
19-
uses: actions-rs/cargo@v1
20-
with:
21-
command: fmt
22-
args: --check
25+
run: cargo fmt --check
2326
clippy:
2427
runs-on: ubuntu-latest
2528
name: ${{ matrix.toolchain }} / clippy
29+
permissions:
30+
contents: read
31+
checks: write
2632
strategy:
2733
fail-fast: false
2834
matrix:
2935
toolchain: [stable, beta]
3036
steps:
31-
- uses: actions/checkout@v3
37+
- uses: actions/checkout@v4
3238
with:
3339
submodules: true
3440
- name: Install ${{ matrix.toolchain }}
@@ -44,51 +50,44 @@ jobs:
4450
runs-on: ubuntu-latest
4551
name: nightly / doc
4652
steps:
47-
- uses: actions/checkout@v3
53+
- uses: actions/checkout@v4
4854
with:
4955
submodules: true
5056
- name: Install nightly
5157
uses: dtolnay/rust-toolchain@nightly
5258
- name: cargo doc
53-
uses: actions-rs/cargo@v1
54-
with:
55-
command: doc
56-
args: --no-deps --all-features
59+
run: cargo doc --no-deps --all-features
5760
env:
5861
RUSTDOCFLAGS: --cfg docsrs
5962
hack:
6063
runs-on: ubuntu-latest
6164
name: ubuntu / stable / features
6265
steps:
63-
- uses: actions/checkout@v3
66+
- uses: actions/checkout@v4
6467
with:
6568
submodules: true
6669
- name: Install stable
6770
uses: dtolnay/rust-toolchain@stable
6871
- name: cargo install cargo-hack
6972
uses: taiki-e/install-action@cargo-hack
73+
# intentionally no target specifier; see https://github.com/jonhoo/rust-ci-conf/pull/4
7074
- name: cargo hack
71-
uses: actions-rs/cargo@v1
72-
with:
73-
command: hack
74-
args: --feature-powerset check --lib --tests
75+
run: cargo hack --feature-powerset check
7576
msrv:
7677
runs-on: ubuntu-latest
7778
# we use a matrix here just because env can't be used in job names
7879
# https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
7980
strategy:
8081
matrix:
81-
msrv: [1.40.0]
82+
msrv: ["1.40.0"]
8283
name: ubuntu / ${{ matrix.msrv }}
8384
steps:
84-
- uses: actions/checkout@v3
85+
- uses: actions/checkout@v4
8586
with:
8687
submodules: true
8788
- name: Install ${{ matrix.msrv }}
8889
uses: dtolnay/rust-toolchain@master
8990
with:
9091
toolchain: ${{ matrix.msrv }}
9192
- name: cargo +${{ matrix.msrv }} check
92-
uses: actions-rs/cargo@v1
93-
with:
94-
command: check
93+
run: cargo check

.github/workflows/coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
image: xd009642/tarpaulin:develop-nightly
1111
options: --security-opt seccomp=unconfined
1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414
- name: Generate code coverage
1515
run: |
16-
cargo +nightly tarpaulin --verbose --all-features --workspace --timeout 120 --run-types Doctests --run-types Tests --out Xml
16+
cargo +nightly tarpaulin --verbose --all-features --workspace --timeout 120 --run-types doctests --run-types lib --run-types tests --out xml
1717
- name: Upload to codecov.io
1818
uses: codecov/codecov-action@v3
1919
with:

.github/workflows/safety.yml

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1+
permissions:
2+
contents: read
13
on:
24
push:
35
branches: [main]
46
pull_request:
7+
# Spend CI time only on latest ref: https://github.com/jonhoo/rust-ci-conf/pull/5
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
10+
cancel-in-progress: true
511
name: safety
612
jobs:
713
sanitizers:
814
runs-on: ubuntu-latest
915
steps:
10-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1117
with:
1218
submodules: true
1319
- name: Install nightly
@@ -17,32 +23,33 @@ jobs:
1723
sudo apt install llvm
1824
# to fix buggy leak analyzer:
1925
# https://github.com/japaric/rust-san#unrealiable-leaksanitizer
20-
sed -i '/\[features\]/i [profile.dev]' Cargo.toml
21-
sed -i '/profile.dev/a opt-level = 1' Cargo.toml
26+
# ensure there's a profile.dev section
27+
if ! grep -qE '^[ \t]*[profile.dev]' Cargo.toml; then
28+
echo >> Cargo.toml
29+
echo '[profile.dev]' >> Cargo.toml
30+
fi
31+
# remove pre-existing opt-levels in profile.dev
32+
sed -i '/^\s*\[profile.dev\]/,/^\s*\[/ {/^\s*opt-level/d}' Cargo.toml
33+
# now set opt-level to 1
34+
sed -i '/^\s*\[profile.dev\]/a opt-level = 1' Cargo.toml
2235
cat Cargo.toml
2336
name: Enable debug symbols
2437
- name: cargo test -Zsanitizer=address
25-
uses: actions-rs/cargo@v1
26-
with:
27-
command: test
28-
# only --lib --tests b/c of https://github.com/rust-lang/rust/issues/53945
29-
args: --lib --tests --all-features --target x86_64-unknown-linux-gnu
38+
# only --lib --tests b/c of https://github.com/rust-lang/rust/issues/53945
39+
run: cargo test --lib --tests --all-features --target x86_64-unknown-linux-gnu
3040
env:
3141
ASAN_OPTIONS: "detect_odr_violation=0:detect_leaks=0"
3242
RUSTFLAGS: "-Z sanitizer=address"
3343
- name: cargo test -Zsanitizer=leak
3444
if: always()
35-
uses: actions-rs/cargo@v1
36-
with:
37-
command: test
38-
args: --all-features --target x86_64-unknown-linux-gnu
45+
run: cargo test --all-features --target x86_64-unknown-linux-gnu
3946
env:
4047
LSAN_OPTIONS: "suppressions=lsan-suppressions.txt"
4148
RUSTFLAGS: "-Z sanitizer=leak"
4249
miri:
4350
runs-on: ubuntu-latest
4451
steps:
45-
- uses: actions/checkout@v3
52+
- uses: actions/checkout@v4
4653
with:
4754
submodules: true
4855
- run: |
@@ -53,25 +60,19 @@ jobs:
5360
toolchain: ${{ env.NIGHTLY }}
5461
components: miri
5562
- name: cargo miri test
56-
uses: actions-rs/cargo@v1
57-
with:
58-
command: miri
59-
args: test
63+
run: cargo miri test
6064
env:
61-
MIRIFLAGS: "-Zmiri-tag-raw-pointers"
65+
MIRIFLAGS: ""
6266
loom:
6367
runs-on: ubuntu-latest
6468
steps:
65-
- uses: actions/checkout@v3
69+
- uses: actions/checkout@v4
6670
with:
6771
submodules: true
6872
- name: Install stable
6973
uses: dtolnay/rust-toolchain@stable
7074
- name: cargo test --test loom
71-
uses: actions-rs/cargo@v1
72-
with:
73-
command: test
74-
args: --release --test loom
75+
run: cargo test --release --test loom
7576
env:
7677
LOOM_MAX_PREEMPTIONS: 3
7778
RUSTFLAGS: "--cfg loom"

.github/workflows/scheduled.yml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
1+
permissions:
2+
contents: read
13
on:
24
push:
35
branches: [main]
46
pull_request:
57
schedule:
68
- cron: '7 7 * * *'
9+
# Spend CI time only on latest ref: https://github.com/jonhoo/rust-ci-conf/pull/5
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
12+
cancel-in-progress: true
713
name: rolling
814
jobs:
915
# https://twitter.com/mycoliza/status/1571295690063753218
1016
nightly:
1117
runs-on: ubuntu-latest
1218
name: ubuntu / nightly
1319
steps:
14-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
1521
with:
1622
submodules: true
1723
- name: Install nightly
1824
uses: dtolnay/rust-toolchain@nightly
1925
- name: cargo generate-lockfile
2026
if: hashFiles('Cargo.lock') == ''
21-
uses: actions-rs/cargo@v1
22-
with:
23-
command: generate-lockfile
27+
run: cargo generate-lockfile
2428
- name: cargo test --locked
25-
uses: actions-rs/cargo@v1
26-
with:
27-
command: test
28-
args: --locked --all-features --all-targets
29+
run: cargo test --locked --all-features --all-targets
2930
# https://twitter.com/alcuadrado/status/1571291687837732873
3031
update:
3132
runs-on: ubuntu-latest
@@ -35,22 +36,17 @@ jobs:
3536
# Unfortunately, hashFiles only works in if on steps, so we reepeat it.
3637
# if: hashFiles('Cargo.lock') != ''
3738
steps:
38-
- uses: actions/checkout@v3
39+
- uses: actions/checkout@v4
3940
with:
4041
submodules: true
4142
- name: Install beta
4243
if: hashFiles('Cargo.lock') != ''
4344
uses: dtolnay/rust-toolchain@beta
4445
- name: cargo update
4546
if: hashFiles('Cargo.lock') != ''
46-
uses: actions-rs/cargo@v1
47-
with:
48-
command: update
47+
run: cargo update
4948
- name: cargo test
5049
if: hashFiles('Cargo.lock') != ''
51-
uses: actions-rs/cargo@v1
52-
with:
53-
command: test
54-
args: --locked --all-features --all-targets
50+
run: cargo test --locked --all-features --all-targets
5551
env:
5652
RUSTFLAGS: -D deprecated

.github/workflows/test.yml

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
permissions:
2+
contents: read
13
on:
24
push:
35
branches: [main]
46
pull_request:
7+
# Spend CI time only on latest ref: https://github.com/jonhoo/rust-ci-conf/pull/5
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
10+
cancel-in-progress: true
511
name: test
612
jobs:
713
required:
@@ -11,7 +17,7 @@ jobs:
1117
matrix:
1218
toolchain: [stable, beta]
1319
steps:
14-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
1521
with:
1622
submodules: true
1723
- name: Install ${{ matrix.toolchain }}
@@ -20,20 +26,18 @@ jobs:
2026
toolchain: ${{ matrix.toolchain }}
2127
- name: cargo generate-lockfile
2228
if: hashFiles('Cargo.lock') == ''
23-
uses: actions-rs/cargo@v1
24-
with:
25-
command: generate-lockfile
29+
run: cargo generate-lockfile
2630
# https://twitter.com/jonhoo/status/1571290371124260865
2731
- name: cargo test --locked
28-
uses: actions-rs/cargo@v1
29-
with:
30-
command: test
31-
args: --locked --all-features --all-targets
32+
run: cargo test --locked --all-features --all-targets
33+
# https://github.com/rust-lang/cargo/issues/6669
34+
- name: cargo test --doc
35+
run: cargo test --locked --all-features --doc
3236
minimal:
3337
runs-on: ubuntu-latest
3438
name: ubuntu / stable / minimal-versions
3539
steps:
36-
- uses: actions/checkout@v3
40+
- uses: actions/checkout@v4
3741
with:
3842
submodules: true
3943
- name: Install stable
@@ -43,16 +47,9 @@ jobs:
4347
- name: rustup default stable
4448
run: rustup default stable
4549
- name: cargo update -Zminimal-versions
46-
uses: actions-rs/cargo@v1
47-
with:
48-
command: update
49-
toolchain: nightly
50-
args: -Zminimal-versions
50+
run: cargo +nightly update -Zminimal-versions
5151
- name: cargo test
52-
uses: actions-rs/cargo@v1
53-
with:
54-
command: test
55-
args: --locked --all-features --all-targets
52+
run: cargo test --locked --all-features --all-targets
5653
os-check:
5754
runs-on: ${{ matrix.os }}
5855
name: ${{ matrix.os }} / stable
@@ -61,20 +58,21 @@ jobs:
6158
matrix:
6259
os: [macos-latest, windows-latest]
6360
steps:
64-
- uses: actions/checkout@v3
61+
# if your project needs OpenSSL, uncommment this to fix Windows builds.
62+
# it's commented out by default as tthe install command takes 5-10m.
63+
# - run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
64+
# if: runner.os == 'Windows'
65+
# - run: vcpkg install openssl:x64-windows-static-md
66+
# if: runner.os == 'Windows'
67+
- uses: actions/checkout@v4
6568
with:
6669
submodules: true
6770
- name: Install stable
6871
uses: dtolnay/rust-toolchain@stable
6972
- name: cargo generate-lockfile
7073
if: hashFiles('Cargo.lock') == ''
71-
uses: actions-rs/cargo@v1
72-
with:
73-
command: generate-lockfile
74+
run: cargo generate-lockfile
7475
- name: cargo test
75-
uses: actions-rs/cargo@v1
76-
with:
77-
command: test
78-
args: --locked --all-features --all-targets
76+
run: cargo test --locked --all-features --all-targets
7977
# continue using our own coverage.yml for now to get doctest checking
8078
# https://github.com/taiki-e/cargo-llvm-cov/issues/2

0 commit comments

Comments
 (0)