From e649d084c30e23d977d3e409e4bf578f7385b41e Mon Sep 17 00:00:00 2001 From: LoricAndre <57358788+LoricAndre@users.noreply.github.com> Date: Tue, 26 Nov 2024 17:42:25 +0100 Subject: [PATCH] chore: improve PR ci (#617) * Bump unicode-width from 0.1.14 to 0.2.0 (#616) Bumps [unicode-width](https://github.com/unicode-rs/unicode-width) from 0.1.14 to 0.2.0. - [Commits](https://github.com/unicode-rs/unicode-width/compare/v0.1.14...v0.2.0) --- updated-dependencies: - dependency-name: unicode-width dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump nix from 0.25.1 to 0.29.0 (#614) Bumps [nix](https://github.com/nix-rust/nix) from 0.25.1 to 0.29.0. - [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md) - [Commits](https://github.com/nix-rust/nix/compare/v0.25.1...v0.29.0) --- updated-dependencies: - dependency-name: nix dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump env_logger from 0.9.3 to 0.11.5 (#615) Bumps [env_logger](https://github.com/rust-cli/env_logger) from 0.9.3 to 0.11.5. - [Release notes](https://github.com/rust-cli/env_logger/releases) - [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md) - [Commits](https://github.com/rust-cli/env_logger/compare/v0.9.3...v0.11.5) --- updated-dependencies: - dependency-name: env_logger dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: LoricAndre <57358788+LoricAndre@users.noreply.github.com> * chore: improve PR ci * disable cache on fmt job * add title check * clean * Create pr.yml --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: LoricAndre --- .github/dependabot.yml | 3 +++ .github/pr-title-checker-config.json | 35 ++++++++++++++++++++++++++ .github/pull_request_template.md | 1 - .github/workflows/pr.yml | 21 ++++++++++++++++ .github/workflows/{ci.yml => test.yml} | 13 ++++------ 5 files changed, 64 insertions(+), 9 deletions(-) create mode 100644 .github/pr-title-checker-config.json create mode 100644 .github/workflows/pr.yml rename .github/workflows/{ci.yml => test.yml} (95%) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 53f8242a..9d51c925 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,3 +4,6 @@ updates: directory: "/" schedule: interval: "weekly" + commit-message: + prefix: chore(deps) + prefix-development: chore(dev-deps) diff --git a/.github/pr-title-checker-config.json b/.github/pr-title-checker-config.json new file mode 100644 index 00000000..73b8a6b8 --- /dev/null +++ b/.github/pr-title-checker-config.json @@ -0,0 +1,35 @@ +{ + "LABEL": { + "name": "invalid-title", + "color": "B60205" + }, + "CHECKS": { + "prefixes": [ + "feat: ", + "feature: ", + "fix: ", + "bugfix: ", + "perf: ", + "refactor: ", + "test: ", + "tests: ", + "build: ", + "ci: ", + "doc: ", + "docs: ", + "style: ", + "chore: ", + "other: " + ], + "regexp": "^\\w+(\\([a-z_-]+\\))?: ", + "regexpFlags": "", + "ignoreLabels": [ + "skip-title-check" + ] + }, + "MESSAGES": { + "success": "PR title is valid", + "failure": "PR title is invalid", + "notice": "" + } +} diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 2c8508d5..4f9cee6f 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,7 +1,6 @@ ## Checklist _check the box if it is not applicable to your changes_ -- [ ] The title of my PR follows the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) convention - [ ] I have updated the README with the necessary documentation - [ ] I have added unit tests - [ ] I have added [end-to-end tests](test/test_skim.py) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 00000000..d434705d --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,21 @@ +name: "PR validation" +on: + pull_request_target: + types: + - opened + - edited + - synchronize + - labeled + - unlabeled + +jobs: + check: + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - uses: thehanimo/pr-title-checker@v1.4.3 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + pass_on_octokit_error: false + configuration_path: .github/pr-title-checker-config.json diff --git a/.github/workflows/ci.yml b/.github/workflows/test.yml similarity index 95% rename from .github/workflows/ci.yml rename to .github/workflows/test.yml index 96970e6a..9ebe4426 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/test.yml @@ -8,8 +8,7 @@ on: - master jobs: - test: - name: test + e2e: runs-on: ${{matrix.os}} strategy: matrix: @@ -54,6 +53,8 @@ jobs: toolchain: ${{ matrix.rust }} target: ${{ matrix.target }} override: true + - name: Cache + uses: Swatinem/rust-cache@v2 - name: Build run: cargo build --release - name: Run Tests @@ -61,11 +62,8 @@ jobs: env: LC_ALL: en_US.UTF-8 TERM: xterm-256color - - name: Cache - uses: Swatinem/rust-cache@v1 clippy: - name: clippy runs-on: ${{matrix.os}} strategy: matrix: @@ -111,13 +109,12 @@ jobs: target: ${{ matrix.target }} override: true components: clippy + - name: Cache + uses: Swatinem/rust-cache@v2 - name: Clippy run: cargo clippy - - name: Cache - uses: Swatinem/rust-cache@v1 rustfmt: - name: rustfmt runs-on: ubuntu-latest steps: - name: Checkout repository