diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..92e09e76 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,21 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + assignees: + - "LGUG2Z" + commit-message: + prefix: chore + include: scope + + - package-ecosystem: "cargo" + directory: "/" + schedule: + interval: "weekly" + assignees: + - "LGUG2Z" + commit-message: + prefix: chore + include: scope \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..5059bfde --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,7 @@ + diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..b84c775b --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,46 @@ +# Every job is gated on the repository, so that a fork does not run them on its own runners. + +name: ci + +on: + pull_request: + branches: + - "*" + push: + branches: + - master + - feature/* + - hotfix/* + tags: + - v* + schedule: + - cron: "30 0 * * 0" # Every Sunday at 00:30 UTC + workflow_dispatch: + +jobs: + cargo-deny: + if: github.repository == 'LGUG2Z/komorebi-for-kde' + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 0 + - uses: EmbarkStudios/cargo-deny-action@v2 + + # Everything that does not need a virtual machine: the formatting, clippy, rustdoc and the tests, + # as derivations. The jobs that boot KWin are separate. + lint: + if: github.repository == 'LGUG2Z/komorebi-for-kde' + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 0 + - uses: cachix/install-nix-action@v31 + - uses: nix-community/cache-nix-action@v7 + with: + primary-key: nix-${{ runner.os }}-${{ hashFiles('flake.lock', '**/Cargo.lock') }} + restore-prefixes-first-match: nix-${{ runner.os }}- + gc-max-store-size-linux: 8G + - run: nix flake check -L + - run: nix develop --command just lint diff --git a/.github/workflows/update-flake-lock.yaml b/.github/workflows/update-flake-lock.yaml new file mode 100644 index 00000000..8507438e --- /dev/null +++ b/.github/workflows/update-flake-lock.yaml @@ -0,0 +1,25 @@ +# komorebi tracks the tip of nixpkgs-unstable, so the lock moves every week. The pull request runs +# the same jobs as any other, which is what says whether the new KWin still works. + +name: update-flake-lock + +on: + schedule: + - cron: "0 3 * * 1" # Every Monday at 03:00 UTC + workflow_dispatch: + +jobs: + update: + if: github.repository == 'LGUG2Z/komorebi-for-kde' + runs-on: ubuntu-24.04 + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/checkout@v7 + - uses: cachix/install-nix-action@v31 + - uses: DeterminateSystems/update-flake-lock@v29 + with: + commit-msg: "chore(deps): flake.lock: Update" + pr-title: "chore(deps): flake.lock: Update" + pr-assignees: LGUG2Z diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7574fec0..2b129d43 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,6 +42,15 @@ warnings denied. `just fmt` formats the Rust sources, and `nix fmt` every file type the repository has. `nix flake check` is what CI runs; it builds the same checks, plus `cargo deny`, as derivations. +## Continuous integration + +[`ci.yaml`](.github/workflows/ci.yaml) runs on every pull request and on every +push to `master`, `feature/*` and `hotfix/*`, in this repository only. The +`lint` job runs `nix flake check` and the repository's own lint rules, and +`cargo-deny` checks licenses and advisories. A weekly +[workflow](.github/workflows/update-flake-lock.yaml) opens a pull request that +moves `flake.lock`, and the same jobs run on it. + ## Commits Commit messages follow the