Skip to content

Commit cfdd57e

Browse files
committed
Maintain
1 parent f589637 commit cfdd57e

File tree

3 files changed

+33
-14
lines changed

3 files changed

+33
-14
lines changed

.github/workflows/checks.yml

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
name: Checks
1+
name: Rust
2+
3+
permissions:
4+
contents: read
25

36
env:
47
CACHE_VERSION: 0
@@ -10,49 +13,54 @@ env:
1013

1114
on:
1215
push:
13-
branches:
14-
- main
16+
branches: [main]
1517
pull_request:
16-
branches:
17-
- main
18+
branches: [main]
1819
merge_group:
1920

21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.ref }}
23+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
24+
2025
jobs:
2126
cargo-checks:
27+
permissions:
28+
actions: write
2229
name: Task cargo ${{ matrix.action }}
2330
runs-on: ubuntu-latest
31+
2432
strategy:
2533
matrix:
2634
action: [clippy, fmt, test]
35+
2736
steps:
2837
- name: Fetch latest code
2938
uses: actions/checkout@v5
39+
3040
- name: Setup build environment
3141
if: matrix.action != 'fmt'
3242
run: rustup show
33-
- uses: Swatinem/rust-cache@v2
43+
44+
- name: Cache cargo target
3445
if: matrix.action != 'fmt'
46+
uses: Swatinem/rust-cache@v2
3547
with:
3648
prefix-key: ${{ env.CACHE_VERSION }}
3749
key: ${{ matrix.action }}
50+
3851
- name: Cargo clippy
3952
if: matrix.action == 'clippy'
4053
uses: giraffate/clippy-action@v1
4154
with:
42-
clippy_flags: --workspace --all-features --all-targets --locked
55+
clippy_flags: --workspace --all-features --all-targets --locked -- -Dwarnings
56+
4357
- name: Cargo fmt
4458
if: matrix.action == 'fmt'
4559
run: |
4660
rustup toolchain install nightly
4761
rustup component add rustfmt --toolchain nightly
4862
cargo +nightly fmt --all -- --check
63+
4964
- name: Cargo test
5065
if: matrix.action == 'test'
5166
run: RUST_MIN_STACK=67108864 cargo test --profile ci-dev --workspace --all-features --all-targets --locked
52-
- name: Fast fail
53-
uses: vishnudxb/cancel-workflow@v1.2
54-
if: failure()
55-
with:
56-
repo: hack-ink/array-bytes
57-
workflow_id: ${{ github.run_id }}
58-
access_token: ${{ github.token }}

.github/workflows/release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Release
22

3+
permissions:
4+
contents: write
5+
actions: write
6+
37
env:
48
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
59
CARGO_TERM_COLOR: always
@@ -11,6 +15,10 @@ on:
1115
tags:
1216
- "v[0-9]+.[0-9]+.[0-9]+"
1317

18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref }}
20+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
21+
1422
jobs:
1523
release:
1624
name: Release
@@ -28,7 +36,9 @@ jobs:
2836
steps:
2937
- name: Fetch latest code
3038
uses: actions/checkout@v5
39+
3140
- name: Login
3241
run: cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }}
42+
3343
- name: Publish
3444
run: cargo publish --locked

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Integrated development environment.
22
.vscode
3+
.zed
34

45
# Package manager.
56
## Cargo.

0 commit comments

Comments
 (0)