Skip to content

Commit

Permalink
Cancel previous CI runs, don't run on draft PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Oct 18, 2023
1 parent e167090 commit b9e9888
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ on:
# Release candidates are tagged as `v<version>-rc<num>`, 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:
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b9e9888

Please sign in to comment.