Skip to content

Commit

Permalink
ci: Update Rust via dev container (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
olix0r authored Mar 29, 2024
1 parent 11e4c60 commit cba67f0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 29 deletions.
49 changes: 21 additions & 28 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
name: Rust PR

on:
pull_request: {}
on: pull_request

env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUSTFLAGS: "-D warnings -A deprecated"
RUSTUP_MAX_RETRIES: 10

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:

Expand All @@ -11,58 +23,39 @@ jobs:
audit:
timeout-minutes: 5
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- uses: EmbarkStudios/cargo-deny-action@b655a95dbfd6f1dacd48f7e869cb37cf4f03a6d9
with:
command: check bans licenses sources

# Prevent sudden announcement of a new advisory from failing Ci.
advisories:
timeout-minutes: 5
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- uses: EmbarkStudios/cargo-deny-action@b655a95dbfd6f1dacd48f7e869cb37cf4f03a6d9
with:
command: check advisories

# Linting
clippy:
timeout-minutes: 5
runs-on: ubuntu-latest
container:
image: docker://rust:1.52.1-buster
permissions:
contents: read
container: docker://ghcr.io/linkerd/dev:v43-rust
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: rustup component add clippy
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84
- run: cargo fetch
- run: cargo clippy --all-targets

# Enforce automated formatting.
fmt:
timeout-minutes: 5
runs-on: ubuntu-latest
container:
image: docker://rust:1.52.1-buster
permissions:
contents: read
container: docker://ghcr.io/linkerd/dev:v43-rust
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: rustup component add rustfmt
- run: cargo fmt -- --check

# Run all tests.
test:
timeout-minutes: 15
runs-on: ubuntu-latest
permissions:
contents: read
container: docker://ghcr.io/linkerd/dev:v43-rust
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84
- run: cargo fetch
- run: cargo test
10 changes: 9 additions & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@ copyleft = "deny"
allow-osi-fsf-free = "neither"
default = "deny"
confidence-threshold = 0.8
exceptions = []
exceptions = [
# The Unicode-DFS-2016 license is necessary for unicode-ident because they
# use data from the unicode tables to generate the tables which are
# included in the application. We do not distribute those data files so
# this is not a problem for us. See https://github.com/dtolnay/unicode-ident/pull/9/files
{ allow = [
"Unicode-DFS-2016",
], name = "unicode-ident", version = "*" },
]

[bans]
multiple-versions = "deny"
Expand Down

0 comments on commit cba67f0

Please sign in to comment.