fix(ci): Merge rust ci jobs into one job (#2)

Reviewed-on: #2
Co-authored-by: Awiteb <a@4rs.nl>
Co-committed-by: Awiteb <a@4rs.nl>
This commit is contained in:
Awiteb 2024-03-17 06:18:13 +01:00
parent e231352009
commit 34eb9d10f0
Signed by: awiteb
GPG key ID: 3F6B55640AA6682F
3 changed files with 20 additions and 31 deletions

View file

@ -1,4 +1,4 @@
name: CI name: Rust CI
on: on:
push: push:
@ -7,32 +7,17 @@ on:
branches: [master] branches: [master]
jobs: jobs:
build: rust_ci:
name: Rust build name: Rust CI
runs-on: debian runs-on: debian
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: https://codeberg.org/TheAwiteb/rust-action@v1.70 - uses: https://codeberg.org/TheAwiteb/rust-action@v1.70
- run: cargo build - name: Build the source code
rustfmt: run: cargo build
name: Rust format - name: Check the code format
runs-on: debian run: cargo fmt -- --check
steps: - name: Run cargo-check
- uses: actions/checkout@v4 run: cargo check
- uses: https://codeberg.org/TheAwiteb/rust-action@v1.70 - name: Run cargo-clippy
- run: cargo fmt -- --check run: cargo clippy -- -D warnings
check:
name: Rust check
runs-on: debian
steps:
- uses: actions/checkout@v4
- uses: https://codeberg.org/TheAwiteb/rust-action@v1.70
- run: cargo check
clippy:
name: Rust clippy
runs-on: debian
steps:
- uses: actions/checkout@v4
- uses: https://codeberg.org/TheAwiteb/rust-action@v1.70
- run: cargo clippy -- -D warnings

View file

@ -1,3 +1,5 @@
name: Check PR title
on: on:
pull_request: pull_request:
types: types:
@ -6,13 +8,15 @@ on:
- reopened - reopened
jobs: jobs:
main: check_pr_title:
runs-on: debian runs-on: debian
steps: steps:
- uses: https://code.forgejo.org/actions/checkout@v4 - uses: https://code.forgejo.org/actions/checkout@v4
- run: | - name: Install git-sumi
curl -L "https://github.com/welpo/git-sumi/releases/download/v0.0.6/git-sumi-x86_64-unknown-linux-gnu.tar.xz" -o git-sumi.tar.xz run: |
curl -s -L "https://github.com/welpo/git-sumi/releases/download/v0.0.6/git-sumi-x86_64-unknown-linux-gnu.tar.xz" -o git-sumi.tar.xz
tar -xf git-sumi.tar.xz tar -xf git-sumi.tar.xz
mv git-sumi-x86_64-unknown-linux-gnu/git-sumi git-sumi mv git-sumi-x86_64-unknown-linux-gnu/git-sumi git-sumi
chmod +x git-sumi chmod +x git-sumi
./git-sumi "${{ github.event.pull_request.title }}" - name: Run git-sumi
run: ./git-sumi "${{ github.event.pull_request.title }}"

View file

@ -54,4 +54,4 @@ types_allowed = ["feat", "fix", "docs", "refactor", "change", "deprecate", "remo
# Rule: Header must match regex pattern. # Rule: Header must match regex pattern.
# Example: '^JIRA-\d+:'. # Example: '^JIRA-\d+:'.
header_pattern = '^\w+(\s\(\w+\))?(!)?: \w' header_pattern = '^\w+(\(\w+\))?(!)?: \w'