From 437cf81cb5d6edcb2fc4e19dca31de68e2943fc7 Mon Sep 17 00:00:00 2001 From: Hendrik Sollich Date: Mon, 27 Nov 2023 00:25:17 +0100 Subject: [PATCH] ci: split out pr-check again --- .github/workflows/ci.yml | 39 +++++------------------------- .github/workflows/pull-request.yml | 36 +++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/pull-request.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 57952707..eb70c418 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -86,7 +59,7 @@ jobs: windows: name: windows - needs: check_commit + needs: pr-check runs-on: windows-latest strategy: matrix: @@ -114,7 +87,7 @@ jobs: macos: name: macos - needs: check_commit + needs: pr-check runs-on: macos-latest strategy: matrix: diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 00000000..b0efc7e6 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -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 +