Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couple more CI improvements #873

Merged
merged 6 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/problem-matchers/rust.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"problemMatcher": [
{
"owner": "rust",
"pattern": [
{
"regexp": "^(warning|warn|error)(\\[(.*)\\])?: (.*)$",
"severity": 1,
"message": 4,
"code": 3
},
{
"regexp": "^([\\s->=]*(.*):(\\d*):(\\d*)|.*)$",
"file": 2,
"line": 3,
"column": 4
}
]
}
]
}
85 changes: 44 additions & 41 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
branches:
- main
pull_request:
branches:
- main
merge_group:
branches:
- main
Expand Down Expand Up @@ -38,6 +36,9 @@ jobs:
workspaces: |
test-framework

- name: Register rust problem matcher
run: echo "::add-matcher::.github/problem-matchers/rust.json"

- name: Run all E2E tests
working-directory: test-framework
run: cargo test -p e2e-tests
Expand Down Expand Up @@ -65,6 +66,9 @@ jobs:
workspaces: |
test-framework

- name: Register rust problem matcher
run: echo "::add-matcher::.github/problem-matchers/rust.json"

- name: Test sudo-test itself
working-directory: test-framework
run: cargo test -p sudo-test
Expand All @@ -73,11 +77,6 @@ jobs:
working-directory: test-framework
run: cargo test -p sudo-compliance-tests -- --include-ignored

- name: prevent the cache from growing too large
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

compliance-tests:
runs-on: ubuntu-latest
timeout-minutes: 20
Expand Down Expand Up @@ -105,6 +104,9 @@ jobs:
workspaces: |
test-framework

- name: Register rust problem matcher
run: echo "::add-matcher::.github/problem-matchers/rust.json"

- name: Run gated compliance tests against sudo-rs
working-directory: test-framework
env:
Expand Down Expand Up @@ -138,6 +140,9 @@ jobs:
workspaces: |
test-framework

- name: Register rust problem matcher
run: echo "::add-matcher::.github/problem-matchers/rust.json"

- name: clippy sudo-test
working-directory: test-framework
run: cargo clippy -p sudo-test --no-deps -- --deny warnings
Expand Down Expand Up @@ -166,16 +171,18 @@ jobs:
tool: cargo-llvm-cov

- name: Install dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libpam0g-dev
version: "1.0"
run: |
sudo apt update
sudo apt install libpam0g-dev

- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "stable"

- name: Register rust problem matcher
run: echo "::add-matcher::.github/problem-matchers/rust.json"

- name: Build
run: cargo build --workspace --all-targets --all-features --release

Expand All @@ -193,25 +200,24 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set rust nightly version
run: echo "NIGHTLY_VERSION=$(curl https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/rustc)" >> $GITHUB_ENV

- name: Install nightly rust
run: |
rustup set profile minimal
rustup override set nightly-${{ env.NIGHTLY_VERSION }}
rustup override set nightly

- name: Install dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libpam0g-dev
version: "1.0"
run: |
sudo apt update
sudo apt install libpam0g-dev

- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "nightly"

- name: Register rust problem matcher
run: echo "::add-matcher::.github/problem-matchers/rust.json"

- name: Update to minimal direct dependencies
run: cargo update -Zdirect-minimal-versions

Expand All @@ -231,16 +237,18 @@ jobs:
run: rustup override set 1.70

- name: Install dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libpam0g-dev
version: "1.0"
run: |
sudo apt update
sudo apt install libpam0g-dev

- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "msrv"

- name: Register rust problem matcher
run: echo "::add-matcher::.github/problem-matchers/rust.json"

- name: Build
run: cargo build --workspace --all-targets --all-features --release

Expand All @@ -254,26 +262,25 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set rust nightly version
run: echo "NIGHTLY_VERSION=$(curl https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)" >> $GITHUB_ENV

- name: Install nightly rust and miri
run: |
rustup set profile minimal
rustup override set nightly-${{ env.NIGHTLY_VERSION }}
rustup override set nightly
rustup component add miri

- name: Install dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libpam0g-dev
version: "1.0"
run: |
sudo apt update
sudo apt install libpam0g-dev

- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: miri

- name: Register rust problem matcher
run: echo "::add-matcher::.github/problem-matchers/rust.json"

- name: Run tests
run: cargo miri test --workspace --all-features miri

Expand All @@ -284,11 +291,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "stable"

- name: Run rustfmt
run: cargo fmt --all -- --check

Expand All @@ -305,6 +307,9 @@ jobs:
with:
shared-key: "stable"

- name: Register rust problem matcher
run: echo "::add-matcher::.github/problem-matchers/rust.json"

- name: Run clippy
run: cargo clippy --no-deps --all-targets --all-features -- --deny warnings

Expand All @@ -321,6 +326,9 @@ jobs:
with:
shared-key: "stable"

- name: Register rust problem matcher
run: echo "::add-matcher::.github/problem-matchers/rust.json"

- name: Build docs
run: cargo doc --no-deps --document-private-items --all-features

Expand All @@ -335,10 +343,5 @@ jobs:
with:
tool: cargo-audit

- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "audit"

- name: Run audit
run: cargo audit
Loading