Skip to content

Commit

Permalink
chore(ci): reduce ci usage
Browse files Browse the repository at this point in the history
Specifically avoid duplicating the number of CI runs by being more
specific about when to run CI on PRs and pushes

Signed-off-by: JP-Ellis <[email protected]>
  • Loading branch information
JP-Ellis committed Jan 9, 2025
1 parent 82e4839 commit 76ebb0b
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 13 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
name: Pact Plugin Examples

on:
- push
- pull_request
push:
branches:
- main
pull_request:
branches:
- main

jobs:
csv-examples:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
name: Pact Plugin Driver (Gradle)

on:
- push
- pull_request
push:
branches:
- main
pull_request:
branches:
- main

jobs:
latest_jdk:
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/plugin-cli.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Pact Plugin CLI

on: [push, pull_request]
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ name: Release workflow

on:
release:
types: [published]

types:
- published
push:
branches:
- main
pull_request:
branches:
- main

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true

This comment has been minimized.

Copy link
@tienvx

tienvx Jan 9, 2025

Contributor

I think cancel-in-progress is useful in term of 'reduce CI usage'.

For example: I created a PR, the CI run, then i realize that I made a mistake, I made change to the code, commit and push. Then the old checks can be stopped to save some server's resources


jobs:
build-release:
Expand Down Expand Up @@ -61,7 +60,7 @@ jobs:
echo "flags=--release" >> "$GITHUB_OUTPUT"
else
echo "flags=" >> "$GITHUB_OUTPUT"
fi
fi
- if: |
github.event_name == 'push' ||
github.event_name == 'pull_request' ||
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
name: Pact Plugin Driver (Rust)

on: [push, pull_request]
on:
release:
types:
- published
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
Expand Down

0 comments on commit 76ebb0b

Please sign in to comment.