Skip to content

Commit 5a1f942

Browse files
jdisantircoh
andauthored
Add lint for CVE-2021-42574 and change CI cache mechanism (#271)
* Add lint for CVE-2021-42574 and change CI cache mechanism * Use a matrix instead of a separate job * Fix missing matrix key Co-authored-by: Russell Cohen <russell.r.cohen@gmail.com>
1 parent 497c13a commit 5a1f942

File tree

2 files changed

+17
-25
lines changed

2 files changed

+17
-25
lines changed

.github/workflows/ci.yaml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,25 @@
11
on: [ pull_request ]
22

3-
env:
4-
rust_version: 1.53.0
5-
63
name: CI
74

85
jobs:
96
test:
107
runs-on: ubuntu-latest
118
name: Compile & Test SDK
9+
strategy:
10+
matrix:
11+
rust_version: [1.53.0, 1.56.1]
1212
steps:
1313
- uses: actions/checkout@v2
14-
- uses: actions/cache@v2
15-
name: Cargo Cache
16-
with:
17-
path: |
18-
~/.cargo/registry
19-
~/.cargo/git
20-
sdk/target
21-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
22-
restore-keys: |
23-
${{ runner.os }}-cargo-
2414
- uses: actions-rs/toolchain@v1
2515
with:
26-
toolchain: ${{ env.rust_version }}
16+
toolchain: ${{ matrix.rust_version }}
2717
default: true
18+
# Pinned to the commit hash of v1.3.0
19+
- uses: Swatinem/rust-cache@842ef286fff290e445b90b4002cc9807c3669641
20+
with:
21+
sharedKey: test
22+
working-directory: sdk
2823
- name: Cargo Test
2924
run: cargo test
3025
env:

.github/workflows/tool-ci.yaml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ on:
33
paths: 'tools/**'
44

55
env:
6-
rust_version: 1.53.0
6+
# The publisher tool can use the latest Rust since it isn't published.
7+
# Build with a minimum of Rust 1.56.1 to check for CVE-2021-42574.
8+
rust_version: 1.56.1
79
rust_toolchain_components: clippy,rustfmt
810

911
name: Tools CI
@@ -14,21 +16,16 @@ jobs:
1416
name: Compile, Test, and Lint the `tools/` path
1517
steps:
1618
- uses: actions/checkout@v2
17-
- uses: actions/cache@v2
18-
name: Cargo Cache
19-
with:
20-
path: |
21-
~/.cargo/registry
22-
~/.cargo/git
23-
tools/publisher/target
24-
key: tools-${{ runner.os }}-cargo-${{ hashFiles('tools/**/Cargo.toml') }}
25-
restore-keys: |
26-
tools-${{ runner.os }}-cargo-
2719
- uses: actions-rs/toolchain@v1
2820
with:
2921
toolchain: ${{ env.rust_version }}
3022
components: ${{ env.rust_toolchain_components }}
3123
default: true
24+
# Pinned to the commit hash of v1.3.0
25+
- uses: Swatinem/rust-cache@842ef286fff290e445b90b4002cc9807c3669641
26+
with:
27+
sharedKey: tools-test
28+
working-directory: tools/publisher
3229
- name: Format Check
3330
run: rustfmt --check --edition 2018 $(find tools -name '*.rs' -print | grep -v /target/)
3431
- name: Cargo Test

0 commit comments

Comments
 (0)