From fc7f1de33129ca14e55beb5853460ef3277e2496 Mon Sep 17 00:00:00 2001 From: wilhelmagren Date: Thu, 14 Dec 2023 09:47:40 +0100 Subject: [PATCH 1/2] [build] add ci and tests workflows --- .github/workflows/ci.yml | 79 +++++++++++++++++++++++++++++++++++++ .github/workflows/tests.yml | 36 +++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..30b2eaa --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,79 @@ +name: CI + +on: + pull_request: + push: + branches: [ main ] + +jobs: + check: + name: Cargo check + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ macos-latest, windows-latest, ubuntu-latest ] + rust: [ stable, nightly ] + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + - name: Cargo check + uses: actions-rs/cargo@v1 + with: + command: check + + format: + name: Cargo format + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest ] + rust: [ stable ] + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + - run: rustup component add rustfmt + - name: Cargo format + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + clippy: + name: Clippy lint + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest ] + rust: [ stable ] + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + components: clippy + override: true + - name: Clippy lint + uses: giraffate/clippy-action@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + reporter: "github-pr-review" + clippy_flags: --all-features + diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..36644e8 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,36 @@ +name: Tests + +on: + pull_request: + push: + branches: [ main ] + +jobs: + tests: + name: Test and codecov + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest ] + rust: [ stable ] + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + components: llvm-tools-preview + override: true + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + - name: Generate coverage report + run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info + - name: Upload coverage report + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: lcov.info + fail_ci_if_error: true From 61f9133cccada8e73e760db1dd7810d74beae309 Mon Sep 17 00:00:00 2001 From: wilhelmagren Date: Thu, 14 Dec 2023 09:49:06 +0100 Subject: [PATCH 2/2] [git] add dependabot config, actions and crates.io --- .github/dependabot.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..47f8834 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: "cargo" + directory: "/" + schedule: + interval: "daily" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily"