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 4, 2024
1 parent 32b34d2 commit 47081aa
Show file tree
Hide file tree
Showing 3 changed files with 81 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
78 changes: 42 additions & 36 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,68 @@
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-coverege:
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: cargo install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --codecov --output-path codecov.json
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: codecov.json
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/sccache-action@v0.0.5
- 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,tracing
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/sccache-action@v0.0.5
- 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 47081aa

Please sign in to comment.