Skip to content

Commit f445f83

Browse files
authored
ci: use nix flake; run only on push to main branch (#25)
Use nix flake to install deps specified in flake.nix. Fixes an issue where a pull request will have two instances of the workflow running on each commit push. The `push` event will now excludes push to branches other than main.
2 parents 8ac3113 + b7b1f91 commit f445f83

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,33 @@ name: CI Checks
33
on:
44
merge_group:
55
push:
6+
branches:
7+
- 'main'
68
pull_request:
79

810
concurrency:
911
group: ${{ github.workflow }}-${{ github.head_ref }}
1012
cancel-in-progress: true
1113

14+
permissions:
15+
contents: read
16+
1217
jobs:
1318
build_test:
1419
runs-on: ubuntu-latest
1520
name: Build and test packages
1621
steps:
17-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v4
1823
with:
1924
fetch-depth: 0
25+
- uses: oolio-group/install-nix-action@master
26+
with:
27+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
28+
nix_path: nixpkgs=channel:nixos-unstable
2029
- name: Run build
21-
run: make
22-
30+
run: nix develop --command make
2331
- name: Run Tests
24-
run: make test
25-
32+
run: nix develop --command make test
2633
- uses: actions/upload-artifact@v4
2734
if: always()
2835
with:

0 commit comments

Comments
 (0)