diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 18477f0..02c69de 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,9 +9,14 @@ on: # Release candidates are tagged as `v-rc`, for example: "0.1.0-rc1". tags: - "v*" - # Also on PRs, just be careful not to publish anything - pull_request: +# Cancel any currently running workflows from the same PR, branch, or +# tag when a new workflow is triggered. +# +# https://stackoverflow.com/a/66336834 +concurrency: + cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.ref }} jobs: ci: diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000..e09a696 --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,33 @@ +name: CI + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +# Cancel any currently running workflows from the same PR, branch, or +# tag when a new workflow is triggered. +# +# https://stackoverflow.com/a/66336834 +concurrency: + cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + +jobs: + ci: + runs-on: ubuntu-20.04 + if: github.event.pull_request.draft == false + + steps: + - uses: actions/checkout@v3 + + - name: Code style + run: cargo fmt --check + + - name: Build + run: cargo check + + - name: Clippy + run: cargo clippy + + - name: Test + run: cargo test