|
15 | 15 | name: Rust |
16 | 16 |
|
17 | 17 | on: |
18 | | - |
19 | 18 | pull_request: |
20 | 19 | branches: |
21 | | - - master |
| 20 | + - master |
| 21 | + - kuadrant |
22 | 22 |
|
23 | 23 | push: |
24 | 24 | branches: |
25 | | - - master |
| 25 | + - master |
| 26 | + - kuadrant |
26 | 27 |
|
27 | 28 | schedule: |
28 | | - - cron: '0 0 * * *' |
| 29 | + - cron: "0 0 * * *" |
29 | 30 |
|
30 | 31 | jobs: |
31 | | - |
32 | | - licenses: |
33 | | - runs-on: ubuntu-latest |
34 | | - |
35 | | - steps: |
36 | | - - uses: actions/checkout@v2 |
37 | | - |
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 . |
43 | | -
|
44 | 32 | stable: |
45 | 33 | runs-on: ubuntu-latest |
46 | 34 |
|
47 | 35 | steps: |
48 | | - - uses: actions/checkout@v2 |
| 36 | + - uses: actions/checkout@v6 |
49 | 37 |
|
50 | | - - name: Update Rust |
51 | | - run: rustup toolchain install stable --component clippy --component rustfmt |
| 38 | + - name: Update Rust |
| 39 | + run: rustup toolchain install stable --component clippy --component rustfmt |
52 | 40 |
|
53 | | - - name: Cache (generate keys) |
54 | | - run: | |
55 | | - cargo generate-lockfile |
56 | | - rustc --version | cut -d " " -f2 - > rust-toolchain |
| 41 | + - name: Cache (generate keys) |
| 42 | + run: | |
| 43 | + cargo generate-lockfile |
| 44 | + rustc --version | cut -d " " -f2 - > rust-toolchain |
57 | 45 |
|
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') }} |
| 46 | + - name: Cache |
| 47 | + uses: actions/cache@v5 |
| 48 | + with: |
| 49 | + path: | |
| 50 | + ~/.cargo/.crates.toml |
| 51 | + ~/.cargo/.crates2.json |
| 52 | + ~/.cargo/bin |
| 53 | + ~/.cargo/registry |
| 54 | + target |
| 55 | + key: ${{ hashFiles('rust-toolchain', 'Cargo.lock') }} |
68 | 56 |
|
69 | | - - name: Cache (cleanup) |
70 | | - run: rm -f rust-toolchain |
| 57 | + - name: Cache (cleanup) |
| 58 | + run: rm -f rust-toolchain |
71 | 59 |
|
72 | | - - name: Build |
73 | | - env: |
74 | | - RUSTFLAGS: -D warnings |
75 | | - run: cargo build --release --all-targets |
| 60 | + - name: Build |
| 61 | + env: |
| 62 | + RUSTFLAGS: -D warnings |
| 63 | + run: cargo build --release --all-targets |
76 | 64 |
|
77 | | - - name: Format (rustfmt) |
78 | | - run: cargo fmt -- --check |
| 65 | + - name: Format (rustfmt) |
| 66 | + run: cargo fmt -- --check |
79 | 67 |
|
80 | | - - name: Format (manifest) |
81 | | - run: cargo verify-project |
| 68 | + - name: Format (manifest) |
| 69 | + run: cargo verify-project |
82 | 70 |
|
83 | | - - name: Package (docs) |
84 | | - run: cargo doc --no-deps |
| 71 | + - name: Package (docs) |
| 72 | + run: cargo doc --no-deps |
85 | 73 |
|
86 | 74 | nightly: |
87 | 75 | runs-on: ubuntu-latest |
88 | 76 |
|
89 | 77 | 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 |
| 78 | + - uses: actions/checkout@v6 |
| 79 | + |
| 80 | + - name: Update Rust |
| 81 | + run: | |
| 82 | + rustup toolchain install nightly --component clippy --component rustfmt |
| 83 | + rustup default nightly |
| 84 | +
|
| 85 | + - name: Cache (generate keys) |
| 86 | + run: | |
| 87 | + cargo generate-lockfile |
| 88 | + rustc --version | tr " " "-" | cut -d "-" -f3,5-7 | cut -b1-18 > rust-toolchain |
| 89 | +
|
| 90 | + - name: Cache |
| 91 | + uses: actions/cache@v5 |
| 92 | + with: |
| 93 | + path: | |
| 94 | + ~/.cargo/.crates.toml |
| 95 | + ~/.cargo/.crates2.json |
| 96 | + ~/.cargo/bin |
| 97 | + ~/.cargo/registry |
| 98 | + target |
| 99 | + key: ${{ hashFiles('rust-toolchain', 'Cargo.lock') }} |
| 100 | + |
| 101 | + - name: Cache (cleanup) |
| 102 | + run: rm -f rust-toolchain |
| 103 | + |
| 104 | + - name: Build |
| 105 | + env: |
| 106 | + RUSTFLAGS: -D warnings |
| 107 | + run: cargo build --release --all-targets |
| 108 | + |
| 109 | + - name: Format (rustfmt) |
| 110 | + run: cargo fmt -- --check |
| 111 | + |
| 112 | + - name: Format (manifest) |
| 113 | + run: cargo verify-project |
| 114 | + |
| 115 | + - name: Package (docs) |
| 116 | + run: cargo doc --no-deps |
129 | 117 |
|
130 | 118 | examples: |
131 | 119 | runs-on: ubuntu-latest |
132 | 120 |
|
133 | 121 | 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 |
187 | | - |
188 | | - outdated: |
189 | | - runs-on: ubuntu-latest |
190 | | - |
191 | | - steps: |
192 | | - - uses: actions/checkout@v2 |
193 | | - |
194 | | - - name: Run cargo outdated |
195 | | - run: cargo outdated --exit-code 1 |
196 | | - |
197 | | - audit: |
198 | | - runs-on: ubuntu-latest |
199 | | - |
200 | | - steps: |
201 | | - - uses: actions/checkout@v2 |
202 | | - |
203 | | - - name: Run cargo audit |
204 | | - run: | |
205 | | - cargo generate-lockfile |
206 | | - cargo audit |
| 122 | + - name: Checkout (test framework) |
| 123 | + uses: actions/checkout@v6 |
| 124 | + |
| 125 | + - name: Checkout (Rust SDK) |
| 126 | + uses: actions/checkout@v6 |
| 127 | + with: |
| 128 | + repository: proxy-wasm/proxy-wasm-rust-sdk |
| 129 | + path: proxy-wasm-rust-sdk |
| 130 | + |
| 131 | + - name: Update Rust |
| 132 | + run: | |
| 133 | + rustup toolchain install stable --component clippy --component rustfmt |
| 134 | + rustup target add wasm32-unknown-unknown |
| 135 | +
|
| 136 | + - name: Cache (generate keys) |
| 137 | + run: | |
| 138 | + cargo generate-lockfile |
| 139 | + cd proxy-wasm-rust-sdk && cargo generate-lockfile && cd .. |
| 140 | + rustc --version | cut -d " " -f2 - > rust-toolchain |
| 141 | +
|
| 142 | + - name: Cache |
| 143 | + uses: actions/cache@v5 |
| 144 | + with: |
| 145 | + path: | |
| 146 | + ~/.cargo/.crates.toml |
| 147 | + ~/.cargo/.crates2.json |
| 148 | + ~/.cargo/bin |
| 149 | + ~/.cargo/registry |
| 150 | + target |
| 151 | + proxy-wasm-rust-sdk/target |
| 152 | + key: ${{ hashFiles('rust-toolchain', 'Cargo.lock', 'proxy-wasm-rust-sdk/Cargo.lock') }} |
| 153 | + |
| 154 | + - name: Cache (cleanup) |
| 155 | + run: rm -f rust-toolchain |
| 156 | + |
| 157 | + - name: Build (test framework) |
| 158 | + env: |
| 159 | + RUSTFLAGS: -D warnings |
| 160 | + run: cargo build --release --all-targets |
| 161 | + |
| 162 | + - name: Build (Rust SDK examples) |
| 163 | + env: |
| 164 | + RUSTFLAGS: -C link-args=-S -D warnings |
| 165 | + run: cd proxy-wasm-rust-sdk && cargo build --release --examples --target=wasm32-unknown-unknown && cd .. |
| 166 | + |
| 167 | + - name: Test (hello_world) |
| 168 | + run: target/release/examples/hello_world proxy-wasm-rust-sdk/target/wasm32-unknown-unknown/release/examples/hello_world.wasm |
| 169 | + |
| 170 | + - name: Test (http_auth_random) |
| 171 | + run: target/release/examples/http_auth_random proxy-wasm-rust-sdk/target/wasm32-unknown-unknown/release/examples/http_auth_random.wasm -a |
| 172 | + |
| 173 | + - name: Test (http_headers) |
| 174 | + run: target/release/examples/http_headers proxy-wasm-rust-sdk/target/wasm32-unknown-unknown/release/examples/http_headers.wasm -a |
0 commit comments