From d700b9036f69822cad8ce2570d94e61ed49f443a Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 8 Apr 2023 09:35:14 +0200 Subject: Initial import Signed-off-by: Matthias Beyer --- .github/dependabot.yml | 11 ++++ .github/workflows/ci.yml | 100 +++++++++++++++++++++++++++++++++++++ .github/workflows/commit-lint.yml | 18 +++++++ .github/workflows/flake-update.yml | 28 +++++++++++ bors.toml | 10 ++++ 5 files changed, 167 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/commit-lint.yml create mode 100644 .github/workflows/flake-update.yml create mode 100644 bors.toml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..8a43b27 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +version: 2 +updates: +- package-ecosystem: cargo + directory: "/" + schedule: + interval: monthly +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: monthly + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..69bd9f7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,100 @@ +name: CI + +on: + push: + branches: [master, staging, trying, release-*] + pull_request: + branches: [master, release-*] + +env: + CARGO_TERM_COLOR: always + +jobs: + check: + name: check + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - 1.60.0 + - stable + - beta + # - nightly + + steps: + - name: Checkout sources + uses: actions/checkout@v3 + - name: Install toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + - uses: swatinem/rust-cache@v2 + - name: cargo-check + run: cargo check --all-features + + + fmt: + name: format + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: 1.60.0 + components: rustfmt + - name: cargo-fmt + run: cargo fmt -- --check + + + test: + name: test + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - 1.60.0 + - stable + - beta + # - nightly + steps: + - name: Checkout sources + uses: actions/checkout@v3 + - name: Install toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + - uses: swatinem/rust-cache@v2 + - name: cargo-test + run: cargo test --all --all-features + + + clippy: + name: clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: 1.60.0 + components: clippy + - uses: swatinem/rust-cache@v2 + - name: cargo-clippy + run: cargo clippy --all --all-targets --all-features -- -D warnings + + + # We need some "accummulation" job here because bors fails (timeouts) to + # listen on matrix builds. + # Hence, we have some kind of dummy here that bors can listen on + ci-success: + name: CI + if: ${{ success() }} + needs: + - check + - clippy + - fmt + - test + runs-on: ubuntu-latest + steps: + - name: CI succeeded + run: exit 0 diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml new file mode 100644 index 0000000..309d637 --- /dev/null +++ b/.github/workflows/commit-lint.yml @@ -0,0 +1,18 @@ +on: + pull_request: + +name: Pull Request Checks + +jobs: + commit-lint: + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-python@v4 + with: + python-version: '3.x' + - run: pip install gitlint + - run: gitlint --commits $(git merge-base origin/master HEAD)..HEAD diff --git a/.github/workflows/flake-update.yml b/.github/workflows/flake-update.yml new file mode 100644 index 0000000..b14dde7 --- /dev/null +++ b/.github/workflows/flake-update.yml @@ -0,0 +1,28 @@ +name: "Update flakes" + +on: + repository_dispatch: + workflow_dispatch: + schedule: + # 01:15 every monday + - cron: '15 1 * * 1' + +jobs: + lockfile: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Install Nix + uses: cachix/install-nix-action@v18 + with: + extra_nix_config: | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + - name: Update flake.lock + uses: DeterminateSystems/update-flake-lock@v15 + with: + pr-title: "Update flake.lock" # Title of PR to be created + # pr-labels: | # Labels to be set on the PR + # dependencies + # automated + diff --git a/bors.toml b/bors.toml new file mode 100644 index 0000000..e0d8180 --- /dev/null +++ b/bors.toml @@ -0,0 +1,10 @@ +# Must pass on the merge with the master branch +status = [ + "CI" +] + +cut_body_after = "
" + +delete_merged_branches = true + + -- cgit v1.2.3