Skip to content

Commit

Permalink
ci: split out pr-check again
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodie committed Nov 26, 2023
1 parent f504ca7 commit 437cf81
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 33 deletions.
39 changes: 6 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,13 @@ on:
pull_request:

jobs:
check_commit:
name: Check Commit Message
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# A PR should not contain too many commits
fetch-depth: 10
- name: Validate commit messages
run: |
git show-ref
curl -sSfL https://github.com/convco/convco/releases/latest/download/convco-ubuntu.zip | zcat > convco
chmod +x convco
./convco check ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
rm convco
check_fmt_clippy:
name: Check Format
needs: check_commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

- name: cargo-fmt
run: cargo fmt --all --check

#- name: clippy
# run: cargo clippy --all-features -- -D warnings
pr_check:
name: pr-check
uses: ./.github/workflows/pull-request.yml

linux:
name: linux
needs: check_commit
needs: pr-check
runs-on: ubuntu-latest
strategy:
#fail-fast: true
Expand Down Expand Up @@ -86,7 +59,7 @@ jobs:

windows:
name: windows
needs: check_commit
needs: pr-check
runs-on: windows-latest
strategy:
matrix:
Expand Down Expand Up @@ -114,7 +87,7 @@ jobs:

macos:
name: macos
needs: check_commit
needs: pr-check
runs-on: macos-latest
strategy:
matrix:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Pull request
# This workflow is triggered on pushes to the repository.
on: [ pull_request, workflow_call, workflow_dispatch ]

jobs:
check:
name: Check Commit Message
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# A PR should not contain too many commits
fetch-depth: 10
- name: Validate commit messages
run: |
git show-ref
curl -sSfL https://github.com/convco/convco/releases/latest/download/convco-ubuntu.zip | zcat > convco
chmod +x convco
./convco check ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
rm convco
check_fmt_clippy:
name: Check Format
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

- name: cargo-fmt
run: cargo fmt --all --check

#- name: clippy
# run: cargo clippy --all-features -- -D warnings

0 comments on commit 437cf81

Please sign in to comment.