Skip to content

Commit 2acfaa6

Browse files
remove duplicate CI actions for PR+branch, speed up pixi install, fix install bug in ci
1 parent c3c7789 commit 2acfaa6

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ on:
99
- main
1010
- master
1111

12+
# Prevent duplicate runs when pushing to a branch with an open PR
13+
# Groups PRs and their corresponding branch pushes together
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event.pull_request.head.ref || github.ref_name }}
16+
cancel-in-progress: true
17+
1218
jobs:
1319
format-and-lint:
1420
name: Format and Lint Check
@@ -22,9 +28,21 @@ jobs:
2228
uses: prefix-dev/[email protected]
2329
with:
2430
pixi-version: "latest"
31+
cache: ${{ github.event_name == 'pull_request' }} # Only cache on PRs
32+
33+
- name: Cache pixi environment
34+
if: github.event_name == 'pull_request'
35+
uses: actions/cache@v4
36+
with:
37+
path: |
38+
~/.pixi
39+
.pixi
40+
key: ${{ runner.os }}-pixi-${{ hashFiles('pixi.lock') }}
41+
restore-keys: |
42+
${{ runner.os }}-pixi-
2543
2644
- name: Install dependencies
27-
run: pixi install --all-environments
45+
run: pixi install
2846

2947
- name: Check formatting
3048
run: pixi run format-check

0 commit comments

Comments
 (0)