Skip to content

Commit

Permalink
Faster CI scripts based on lib-bdd template.
Browse files Browse the repository at this point in the history
  • Loading branch information
daemontus committed May 8, 2023
1 parent 8549ac8 commit a9aca89
Showing 1 changed file with 34 additions and 33 deletions.
67 changes: 34 additions & 33 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
# A fixed version used for testing, so that the builds don't
# spontaneously break after a few years.
# Make sure to update this from time to time.
RUST_VERSION: "1.65.0"
RUST_VERSION: "1.69.0"
jobs:
# Check formatting
fmt:
Expand All @@ -23,12 +23,12 @@ jobs:
env:
RUSTFLAGS: "-D warnings"
steps:
- name: Checkout.
uses: actions/checkout@v3
- name: Install Rust toolchain.
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain ${{ env.RUST_VERSION }}
- name: Rust format check.
run: cargo fmt --all -- --check
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
components: rustfmt
- run: cargo fmt --all -- --check

# Run basic code validity check.
check:
Expand All @@ -38,12 +38,11 @@ jobs:
env:
RUSTFLAGS: "-D warnings"
steps:
- name: Checkout.
uses: actions/checkout@v3
- name: Install Rust toolchain.
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain ${{ env.RUST_VERSION }}
- name: Rust code validity check.
run: cargo check
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
- run: cargo check --all-features

# Run all tests
test:
Expand All @@ -62,12 +61,12 @@ jobs:
version: 4.11.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout.
uses: actions/checkout@v3
- name: Install Rust toolchain.
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain ${{ env.RUST_VERSION }}
- name: Run tests.
run: cargo test --all-features
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
components: rustfmt
- run: cargo test --all-features

# Check code style
clippy:
Expand All @@ -77,12 +76,12 @@ jobs:
env:
RUSTFLAGS: "-D warnings"
steps:
- name: Checkout.
uses: actions/checkout@v3
- name: Install Rust toolchain.
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain ${{ env.RUST_VERSION }}
- name: Run clippy.
run: cargo clippy
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
components: clippy
- run: cargo clippy --all-features

# Compute code coverage
codecov:
Expand All @@ -92,25 +91,27 @@ jobs:
steps:
- name: Checkout.
uses: actions/checkout@v3
- name: Install Rust toolchain.
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain ${{ env.RUST_VERSION }}
- name: Setup Z3.
id: z3
uses: cda-tum/setup-z3@v1
with:
version: 4.11.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup cargo-tarpaulin.
run: cargo install cargo-tarpaulin
- name: Run tarpaulin to compute coverage.
run: cargo tarpaulin --verbose --lib --examples --all-features --out Xml
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
# Install action using cargo-binstall, which is faster because we don't have to compile tarpaulin every time.
- uses: taiki-e/install-action@v2
with:
tool: cargo-tarpaulin
- run: cargo tarpaulin --verbose --lib --examples --all-features --out Xml
- name: Upload to codecov.io
uses: codecov/codecov-action@v1.0.2
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Archive code coverage results
uses: actions/upload-artifact@v1
with:
name: code-coverage-report
path: cobertura.xml
path: cobertura.xml

0 comments on commit a9aca89

Please sign in to comment.