11name : Release
22
33env :
4+ CACHE_VERSION : 0
5+
46 CARGO_REGISTRIES_CRATES_IO_PROTOCOL : sparse
57 CARGO_TERM_COLOR : always
68
@@ -15,8 +17,60 @@ permissions:
1517 contents : read
1618
1719jobs :
20+ cargo-checks :
21+ name : Task cargo ${{ matrix.action }}
22+ runs-on : ubuntu-latest
23+ strategy :
24+ fail-fast : false
25+ matrix :
26+ action : [clippy, fmt, nextest, vstyle]
27+ steps :
28+ - name : Fetch latest code
29+ uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
30+ - name : Setup build environment
31+ if : matrix.action != 'fmt'
32+ run : rustup show
33+ - uses : Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4
34+ if : matrix.action != 'fmt'
35+ with :
36+ prefix-key : release-${{ env.CACHE_VERSION }}
37+ key : ${{ matrix.action }}
38+ - name : Install cargo-make
39+ uses : taiki-e/install-action@c93ccc03e00cd0e08e494f5fd058a6c55a6a1907
40+ with :
41+ tool : cargo-make
42+ - name : Install taplo
43+ if : matrix.action == 'fmt'
44+ uses : taiki-e/install-action@c93ccc03e00cd0e08e494f5fd058a6c55a6a1907
45+ with :
46+ tool : taplo
47+ - name : Cargo clippy
48+ if : matrix.action == 'clippy'
49+ run : cargo make lint-rust
50+ - name : Cargo fmt
51+ if : matrix.action == 'fmt'
52+ run : |
53+ rustup toolchain install nightly
54+ rustup component add rustfmt --toolchain nightly
55+ cargo make fmt-check
56+ - name : Install cargo-nextest
57+ if : matrix.action == 'nextest'
58+ uses : taiki-e/install-action@c93ccc03e00cd0e08e494f5fd058a6c55a6a1907
59+ with :
60+ tool : nextest
61+ - name : Cargo nextest
62+ if : matrix.action == 'nextest'
63+ run : cargo make test-rust
64+ - name : Install cargo-vstyle
65+ if : matrix.action == 'vstyle'
66+ run : cargo install --git https://github.com/hack-ink/vibe-style --rev f509613696c60fbc5e444072469024888d91d88b --locked
67+ - name : Cargo vstyle
68+ if : matrix.action == 'vstyle'
69+ run : cargo make lint-vstyle-rust
70+
1871 release :
1972 name : Release
73+ needs : publish-on-crates-io
2074 permissions :
2175 contents : write
2276 runs-on : ubuntu-latest
2882
2983 publish-on-crates-io :
3084 name : Publish on crates.io
85+ needs : cargo-checks
3186 runs-on : ubuntu-latest
3287 steps :
3388 - name : Fetch latest code
0 commit comments