Skip to content

Commit

Permalink
Enable test coverage details and enable dependabot
Browse files Browse the repository at this point in the history
  • Loading branch information
Dekker1 committed Oct 3, 2024
1 parent 253ba80 commit 738423d
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 36 deletions.
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
24 changes: 24 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Check Format

on:
pull_request:
branches-ignore: ["dependabot/**"]

env:
# Lets us format with unstable rustfmt options
RUST_CHANNEL: nightly

jobs:
check_format:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

# Check formatting of Rust files
- name: Install Rust toolchain
run: |
rustup toolchain install --profile minimal --component rustfmt --no-self-update ${{ env.RUST_CHANNEL }}
rustup default ${{ env.RUST_CHANNEL }}
- name: Run cargo format
run: cargo +nightly fmt --all --check
86 changes: 50 additions & 36 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,76 @@
name: Rust
name: Run Tests

on:
push:
branches: ["develop"]
branches:
- "develop"
pull_request:
branches: ["develop"]
workflow_dispatch:

env:
CARGO_TERM_COLOR: always
RUST_CHANNEL: stable
# Lets us format with unstable rustfmt options
RUST_FMT_CHANNEL: nightly
RUST_CHANNEL: "stable"
RUST_COV_CHANNEL: "nightly"

jobs:
test-covereage:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust toolchain
uses: moonrepo/setup-rust@v0
with:
cache: false
channel: ${{ env.RUST_COV_CHANNEL }}
- name: Install grcov
uses: SierraSoftworks/setup-grcov@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run cargo test
run: cargo test
env:
CARGO_INCREMENTAL: "0"
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
RUSTDOCFLAGS: "-Cpanic=abort"
- name: Collect covereage data
run: grcov . --binary-path target/debug/deps/ -s . -t lcov --ignore-not-existing --ignore '../**' --ignore '/*' -o ./lcov.info
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./lcov.info
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
os: [windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust toolchain
run: |
rustup toolchain install --profile minimal --no-self-update ${{ env.RUST_CHANNEL }}
rustup default ${{ env.RUST_CHANNEL }}
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Run cargo test
run: cargo test --features splr,cadical,kissat,intel-sat,ipasir-up
if: matrix.os == 'ubuntu-latest'
uses: moonrepo/setup-rust@v0
with:
cache: false
channel: ${{ env.RUST_COV_CHANNEL }}
- name: Run cargo test
run: cargo test -p pindakaas --features splr,cadical,ipasir-up
run: cargo test -p pindakaas --features splr,cadical,ipasir-up,trace
if: matrix.os == 'windows-latest'
- name: Run cargo test
run: cargo test --all-features
if: matrix.os != 'windows-latest'
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust toolchain
run: |
rustup toolchain install --profile minimal --component clippy --no-self-update ${{ env.RUST_CHANNEL }}
rustup default ${{ env.RUST_CHANNEL }}
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Run clippy
run: cargo clippy --tests --features splr,cadical,kissat,intel-sat,ipasir-up -- -D warnings
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain and clippy
uses: moonrepo/setup-rust@v0
with:
submodules: true
- name: Install Rust toolchain
run: |
rustup toolchain install --profile minimal --component rustfmt --no-self-update ${{ env.RUST_FMT_CHANNEL }}
rustup default ${{ env.RUST_CHANNEL }}
- name: Run cargo format
run: cargo +nightly fmt --all --check
channel: ${{ env.RUST_CHANNEL }}
components: clippy
- name: Run clippy
run: cargo clippy --tests -- -D warnings
- name: Run clippy with all features
run: cargo clippy --tests --all-features -- -D warnings

0 comments on commit 738423d

Please sign in to comment.