Skip to content

Commit b2ad59c

Browse files
authored
Move optional checks to the end. (#28)
While there, align style with the test framework. Signed-off-by: Piotr Sikora <[email protected]>
1 parent 00782e2 commit b2ad59c

File tree

1 file changed

+53
-53
lines changed

1 file changed

+53
-53
lines changed

.github/workflows/rust.yml

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -41,29 +41,41 @@ jobs:
4141
export PATH=$PATH:$(go env GOPATH)/bin
4242
addlicense -check .
4343
44-
audit:
44+
bazel:
4545
runs-on: ubuntu-latest
4646

4747
steps:
4848
- uses: actions/checkout@v2
4949

50-
- name: Run cargo audit
51-
run: |
52-
cp -p cargo/Cargo.lock .
53-
cargo audit
54-
55-
outdated:
56-
runs-on: ubuntu-latest
50+
- name: Cache
51+
uses: actions/cache@v2
52+
with:
53+
path: |
54+
~/.cache/bazel
55+
~/.cache/bazelisk
56+
~/.cargo/.crates.toml
57+
~/.cargo/.crates2.json
58+
~/.cargo/bin
59+
~/.cargo/registry
60+
key: ${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'cargo/Cargo.lock') }}
5761

58-
steps:
59-
- uses: actions/checkout@v2
62+
- name: Build
63+
run: bazelisk build //...
6064

61-
- name: Run cargo outdated
62-
run: cargo outdated --exit-code 1
65+
- name: Format (buildifier)
66+
run: |
67+
GO111MODULE=on go get -u github.com/bazelbuild/buildtools/[email protected]
68+
export PATH=$PATH:$(go env GOPATH)/bin
69+
buildifier -mode=check WORKSPACE
70+
buildifier -mode=check BUILD
71+
buildifier -mode=check examples/BUILD
6372
64-
- name: Check freshness of cargo/Cargo.lock
73+
- name: Format (cargo raze)
6574
run: |
66-
cargo generate-lockfile
75+
cargo install cargo-raze --version 0.3.8
76+
cp -p cargo/Cargo.lock .
77+
rm -rf cargo/
78+
cargo raze --output=cargo
6779
mv Cargo.lock cargo/
6880
git diff --exit-code
6981
@@ -80,13 +92,13 @@ jobs:
8092
8193
- name: Build
8294
env:
83-
RUSTFLAGS: -C link-args=-S -D warnings
84-
run: cargo build --target=wasm32-unknown-unknown --release --all-targets
95+
RUSTFLAGS: -D warnings -C link-args=-S
96+
run: cargo build --release --all-targets --target=wasm32-unknown-unknown
8597

8698
- name: Format (clippy)
8799
env:
88-
RUSTFLAGS: -C link-args=-S -D warnings
89-
run: cargo clippy --target=wasm32-unknown-unknown --release --all-targets
100+
RUSTFLAGS: -D warnings -C link-args=-S
101+
run: cargo clippy --release --all-targets --target=wasm32-unknown-unknown
90102

91103
- name: Format (rustfmt)
92104
run: cargo fmt -- --check
@@ -110,64 +122,52 @@ jobs:
110122
run: |
111123
rustup toolchain install nightly --component clippy --component rustfmt
112124
rustup +nightly target add wasm32-unknown-unknown
125+
rustup default nightly
113126
114127
- name: Build
115128
env:
116-
RUSTFLAGS: -C link-args=-S -D warnings
117-
run: cargo +nightly build --target=wasm32-unknown-unknown --release --all-targets
129+
RUSTFLAGS: -D warnings -C link-args=-S
130+
run: cargo build --release --all-targets --target=wasm32-unknown-unknown
118131

119132
- name: Format (clippy)
120133
env:
121-
RUSTFLAGS: -C link-args=-S -D warnings
122-
run: cargo +nightly clippy --target=wasm32-unknown-unknown --release --all-targets
134+
RUSTFLAGS: -D warnings -C link-args=-S
135+
run: cargo clippy --release --all-targets --target=wasm32-unknown-unknown
123136

124137
- name: Format (rustfmt)
125-
run: cargo +nightly fmt -- --check
138+
run: cargo fmt -- --check
126139

127140
- name: Format (manifest)
128-
run: cargo +nightly verify-project
141+
run: cargo verify-project
129142

130143
- name: Package (docs)
131-
run: cargo +nightly doc --no-deps --target=wasm32-unknown-unknown
144+
run: cargo doc --no-deps --target=wasm32-unknown-unknown
132145

133146
- name: Package (publish)
134-
run: cargo +nightly publish --dry-run --target=wasm32-unknown-unknown
147+
run: cargo publish --dry-run --target=wasm32-unknown-unknown
135148

136-
bazel:
149+
outdated:
137150
runs-on: ubuntu-latest
138151

139152
steps:
140153
- uses: actions/checkout@v2
141154

142-
- name: Cache
143-
uses: actions/cache@v2
144-
with:
145-
path: |
146-
~/.cache/bazel
147-
~/.cache/bazelisk
148-
~/.cargo/.crates.toml
149-
~/.cargo/.crates2.json
150-
~/.cargo/bin
151-
~/.cargo/registry
152-
key: ${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'cargo/Cargo.lock') }}
155+
- name: Run cargo outdated
156+
run: cargo outdated --exit-code 1
153157

154-
- name: Build
158+
- name: Check freshness of cargo/Cargo.lock
155159
run: |
156-
bazelisk build //...
160+
cargo generate-lockfile
161+
mv Cargo.lock cargo/
162+
git diff --exit-code
157163
158-
- name: Format (buildifier)
159-
run: |
160-
GO111MODULE=on go get -u github.com/bazelbuild/buildtools/[email protected]
161-
export PATH=$PATH:$(go env GOPATH)/bin
162-
buildifier -mode=check WORKSPACE
163-
buildifier -mode=check BUILD
164-
buildifier -mode=check examples/BUILD
164+
audit:
165+
runs-on: ubuntu-latest
165166

166-
- name: Format (cargo raze)
167+
steps:
168+
- uses: actions/checkout@v2
169+
170+
- name: Run cargo audit
167171
run: |
168-
cargo install cargo-raze --version 0.3.8
169172
cp -p cargo/Cargo.lock .
170-
rm -rf cargo/
171-
cargo raze --output=cargo
172-
mv Cargo.lock cargo/
173-
git diff --exit-code
173+
cargo audit

0 commit comments

Comments
 (0)