Skip to content

Commit cfc1210

Browse files
Update github actions
Signed-off-by: Adam Cattermole <a.d.cattermole@gmail.com>
1 parent 33b318b commit cfc1210

1 file changed

Lines changed: 138 additions & 140 deletions

File tree

.github/workflows/rust.yml

Lines changed: 138 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -15,192 +15,190 @@
1515
name: Rust
1616

1717
on:
18-
1918
pull_request:
2019
branches:
21-
- master
20+
- master
2221

2322
push:
2423
branches:
25-
- master
24+
- master
2625

2726
schedule:
28-
- cron: '0 0 * * *'
27+
- cron: "0 0 * * *"
2928

3029
jobs:
31-
3230
licenses:
3331
runs-on: ubuntu-latest
3432

3533
steps:
36-
- uses: actions/checkout@v2
34+
- uses: actions/checkout@v6
3735

38-
- name: Check licenses
39-
run: |
40-
go get -u github.com/google/addlicense
41-
export PATH=$PATH:$(go env GOPATH)/bin
42-
addlicense -check .
36+
- name: Check licenses
37+
run: |
38+
go get -u github.com/google/addlicense
39+
export PATH=$PATH:$(go env GOPATH)/bin
40+
addlicense -check .
4341
4442
stable:
4543
runs-on: ubuntu-latest
4644

4745
steps:
48-
- uses: actions/checkout@v2
46+
- uses: actions/checkout@v6
4947

50-
- name: Update Rust
51-
run: rustup toolchain install stable --component clippy --component rustfmt
48+
- name: Update Rust
49+
run: rustup toolchain install stable --component clippy --component rustfmt
5250

53-
- name: Cache (generate keys)
54-
run: |
55-
cargo generate-lockfile
56-
rustc --version | cut -d " " -f2 - > rust-toolchain
51+
- name: Cache (generate keys)
52+
run: |
53+
cargo generate-lockfile
54+
rustc --version | cut -d " " -f2 - > rust-toolchain
5755
58-
- name: Cache
59-
uses: actions/cache@v2
60-
with:
61-
path: |
62-
~/.cargo/.crates.toml
63-
~/.cargo/.crates2.json
64-
~/.cargo/bin
65-
~/.cargo/registry
66-
target
67-
key: ${{ hashFiles('rust-toolchain', 'Cargo.lock') }}
56+
- name: Cache
57+
uses: actions/cache@v5
58+
with:
59+
path: |
60+
~/.cargo/.crates.toml
61+
~/.cargo/.crates2.json
62+
~/.cargo/bin
63+
~/.cargo/registry
64+
target
65+
key: ${{ hashFiles('rust-toolchain', 'Cargo.lock') }}
6866

69-
- name: Cache (cleanup)
70-
run: rm -f rust-toolchain
67+
- name: Cache (cleanup)
68+
run: rm -f rust-toolchain
7169

72-
- name: Build
73-
env:
74-
RUSTFLAGS: -D warnings
75-
run: cargo build --release --all-targets
70+
- name: Build
71+
env:
72+
RUSTFLAGS: -D warnings
73+
run: cargo build --release --all-targets
7674

77-
- name: Format (rustfmt)
78-
run: cargo fmt -- --check
75+
- name: Format (rustfmt)
76+
run: cargo fmt -- --check
7977

80-
- name: Format (manifest)
81-
run: cargo verify-project
78+
- name: Format (manifest)
79+
run: cargo verify-project
8280

83-
- name: Package (docs)
84-
run: cargo doc --no-deps
81+
- name: Package (docs)
82+
run: cargo doc --no-deps
8583

8684
nightly:
8785
runs-on: ubuntu-latest
8886

8987
steps:
90-
- uses: actions/checkout@v2
91-
92-
- name: Update Rust
93-
run: |
94-
rustup toolchain install nightly --component clippy --component rustfmt
95-
rustup default nightly
96-
97-
- name: Cache (generate keys)
98-
run: |
99-
cargo generate-lockfile
100-
rustc --version | tr " " "-" | cut -d "-" -f3,5-7 | cut -b1-18 > rust-toolchain
101-
102-
- name: Cache
103-
uses: actions/cache@v2
104-
with:
105-
path: |
106-
~/.cargo/.crates.toml
107-
~/.cargo/.crates2.json
108-
~/.cargo/bin
109-
~/.cargo/registry
110-
target
111-
key: ${{ hashFiles('rust-toolchain', 'Cargo.lock') }}
112-
113-
- name: Cache (cleanup)
114-
run: rm -f rust-toolchain
115-
116-
- name: Build
117-
env:
118-
RUSTFLAGS: -D warnings
119-
run: cargo build --release --all-targets
120-
121-
- name: Format (rustfmt)
122-
run: cargo fmt -- --check
123-
124-
- name: Format (manifest)
125-
run: cargo verify-project
126-
127-
- name: Package (docs)
128-
run: cargo doc --no-deps
88+
- uses: actions/checkout@v6
89+
90+
- name: Update Rust
91+
run: |
92+
rustup toolchain install nightly --component clippy --component rustfmt
93+
rustup default nightly
94+
95+
- name: Cache (generate keys)
96+
run: |
97+
cargo generate-lockfile
98+
rustc --version | tr " " "-" | cut -d "-" -f3,5-7 | cut -b1-18 > rust-toolchain
99+
100+
- name: Cache
101+
uses: actions/cache@v5
102+
with:
103+
path: |
104+
~/.cargo/.crates.toml
105+
~/.cargo/.crates2.json
106+
~/.cargo/bin
107+
~/.cargo/registry
108+
target
109+
key: ${{ hashFiles('rust-toolchain', 'Cargo.lock') }}
110+
111+
- name: Cache (cleanup)
112+
run: rm -f rust-toolchain
113+
114+
- name: Build
115+
env:
116+
RUSTFLAGS: -D warnings
117+
run: cargo build --release --all-targets
118+
119+
- name: Format (rustfmt)
120+
run: cargo fmt -- --check
121+
122+
- name: Format (manifest)
123+
run: cargo verify-project
124+
125+
- name: Package (docs)
126+
run: cargo doc --no-deps
129127

130128
examples:
131129
runs-on: ubuntu-latest
132130

133131
steps:
134-
- name: Checkout (test framework)
135-
uses: actions/checkout@v2
136-
137-
- name: Checkout (Rust SDK)
138-
uses: actions/checkout@v2
139-
with:
140-
repository: proxy-wasm/proxy-wasm-rust-sdk
141-
path: proxy-wasm-rust-sdk
142-
143-
- name: Update Rust
144-
run: |
145-
rustup toolchain install stable --component clippy --component rustfmt
146-
rustup target add wasm32-unknown-unknown
147-
148-
- name: Cache (generate keys)
149-
run: |
150-
cargo generate-lockfile
151-
cd proxy-wasm-rust-sdk && cargo generate-lockfile && cd ..
152-
rustc --version | cut -d " " -f2 - > rust-toolchain
153-
154-
- name: Cache
155-
uses: actions/cache@v2
156-
with:
157-
path: |
158-
~/.cargo/.crates.toml
159-
~/.cargo/.crates2.json
160-
~/.cargo/bin
161-
~/.cargo/registry
162-
target
163-
proxy-wasm-rust-sdk/target
164-
key: ${{ hashFiles('rust-toolchain', 'Cargo.lock', 'proxy-wasm-rust-sdk/Cargo.lock') }}
165-
166-
- name: Cache (cleanup)
167-
run: rm -f rust-toolchain
168-
169-
- name: Build (test framework)
170-
env:
171-
RUSTFLAGS: -D warnings
172-
run: cargo build --release --all-targets
173-
174-
- name: Build (Rust SDK examples)
175-
env:
176-
RUSTFLAGS: -C link-args=-S -D warnings
177-
run: cd proxy-wasm-rust-sdk && cargo build --release --examples --target=wasm32-unknown-unknown && cd ..
178-
179-
- name: Test (hello_world)
180-
run: target/release/examples/hello_world proxy-wasm-rust-sdk/target/wasm32-unknown-unknown/release/examples/hello_world.wasm
181-
182-
- name: Test (http_auth_random)
183-
run: target/release/examples/http_auth_random proxy-wasm-rust-sdk/target/wasm32-unknown-unknown/release/examples/http_auth_random.wasm -a
184-
185-
- name: Test (http_headers)
186-
run: target/release/examples/http_headers proxy-wasm-rust-sdk/target/wasm32-unknown-unknown/release/examples/http_headers.wasm -a
132+
- name: Checkout (test framework)
133+
uses: actions/checkout@v6
134+
135+
- name: Checkout (Rust SDK)
136+
uses: actions/checkout@v6
137+
with:
138+
repository: proxy-wasm/proxy-wasm-rust-sdk
139+
path: proxy-wasm-rust-sdk
140+
141+
- name: Update Rust
142+
run: |
143+
rustup toolchain install stable --component clippy --component rustfmt
144+
rustup target add wasm32-unknown-unknown
145+
146+
- name: Cache (generate keys)
147+
run: |
148+
cargo generate-lockfile
149+
cd proxy-wasm-rust-sdk && cargo generate-lockfile && cd ..
150+
rustc --version | cut -d " " -f2 - > rust-toolchain
151+
152+
- name: Cache
153+
uses: actions/cache@v5
154+
with:
155+
path: |
156+
~/.cargo/.crates.toml
157+
~/.cargo/.crates2.json
158+
~/.cargo/bin
159+
~/.cargo/registry
160+
target
161+
proxy-wasm-rust-sdk/target
162+
key: ${{ hashFiles('rust-toolchain', 'Cargo.lock', 'proxy-wasm-rust-sdk/Cargo.lock') }}
163+
164+
- name: Cache (cleanup)
165+
run: rm -f rust-toolchain
166+
167+
- name: Build (test framework)
168+
env:
169+
RUSTFLAGS: -D warnings
170+
run: cargo build --release --all-targets
171+
172+
- name: Build (Rust SDK examples)
173+
env:
174+
RUSTFLAGS: -C link-args=-S -D warnings
175+
run: cd proxy-wasm-rust-sdk && cargo build --release --examples --target=wasm32-unknown-unknown && cd ..
176+
177+
- name: Test (hello_world)
178+
run: target/release/examples/hello_world proxy-wasm-rust-sdk/target/wasm32-unknown-unknown/release/examples/hello_world.wasm
179+
180+
- name: Test (http_auth_random)
181+
run: target/release/examples/http_auth_random proxy-wasm-rust-sdk/target/wasm32-unknown-unknown/release/examples/http_auth_random.wasm -a
182+
183+
- name: Test (http_headers)
184+
run: target/release/examples/http_headers proxy-wasm-rust-sdk/target/wasm32-unknown-unknown/release/examples/http_headers.wasm -a
187185

188186
outdated:
189187
runs-on: ubuntu-latest
190188

191189
steps:
192-
- uses: actions/checkout@v2
190+
- uses: actions/checkout@v6
193191

194-
- name: Run cargo outdated
195-
run: cargo outdated --exit-code 1
192+
- name: Run cargo outdated
193+
run: cargo outdated --exit-code 1
196194

197195
audit:
198196
runs-on: ubuntu-latest
199197

200198
steps:
201-
- uses: actions/checkout@v2
199+
- uses: actions/checkout@v6
202200

203-
- name: Run cargo audit
204-
run: |
205-
cargo generate-lockfile
206-
cargo audit
201+
- name: Run cargo audit
202+
run: |
203+
cargo generate-lockfile
204+
cargo audit

0 commit comments

Comments
 (0)