Skip to content

Commit c8de288

Browse files
authored
ci: improve workflow efficiency with best practices (#609)
- Limit workflow triggers to main branch for pushes - Run tests on PRs targeting any branch - Add concurrency control to cancel outdated workflow runs - Set 15-minute timeout to prevent hung jobs - Follows GitHub Actions best practices for open-source projects
1 parent 7bd9e3d commit c8de288

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/test.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
name: Run Tests
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
412

513
jobs:
614
test:
715
runs-on: ${{ matrix.os }}
16+
timeout-minutes: 15
817

918
strategy:
1019
fail-fast: false

0 commit comments

Comments
 (0)