diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..822574943b --- /dev/null +++ b/.github/dependabot.yml @@ -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" diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000000..d6aafa6cf5 --- /dev/null +++ b/.github/workflows/format.yml @@ -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 diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1eb59afa02..fb0fd59984 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -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