Skip to content

Commit 91b3a38

Browse files
committed
check on pr
1 parent 782fd30 commit 91b3a38

2 files changed

Lines changed: 41 additions & 1 deletion

File tree

.github/workflows/check.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: "Test template"
22
on:
33
workflow_dispatch: # allows manual triggering
4-
pull_request:
54
push:
65
jobs:
76
tests:
@@ -11,6 +10,9 @@ jobs:
1110
os: [ubuntu-latest]
1211
steps:
1312
- uses: actions/checkout@v4
13+
- uses: wimpysworld/nothing-but-nix@main
14+
with:
15+
️hatchet-protocol: 'carve'
1416
- uses: cachix/install-nix-action@v31
1517
with:
1618
github_access_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/check_pr.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: "Test template PR"
2+
on:
3+
workflow_dispatch: # allows manual triggering
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
pull_request_target:
7+
types: [opened, synchronize, reopened]
8+
jobs:
9+
tests:
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest]
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
ref: ${{ github.event.pull_request.head.sha }}
18+
token: ${{ secrets.GITHUB_TOKEN }}
19+
- uses: wimpysworld/nothing-but-nix@main
20+
with:
21+
️hatchet-protocol: 'carve'
22+
- uses: cachix/install-nix-action@v31
23+
with:
24+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
25+
- uses: DeterminateSystems/magic-nix-cache-action@main
26+
- run: nix build ./templates/n
27+
- run: nix flake check ./templates/n
28+
- name: Comment on PR (if tests fail)
29+
if: failure()
30+
uses: actions/github-script@main
31+
with:
32+
script: |
33+
github.rest.issues.createComment({
34+
issue_number: context.issue.number,
35+
owner: context.repo.owner,
36+
repo: context.repo.repo,
37+
body: '❌ Tests failed on this pull request. Please check the workflow logs for details.'
38+
})

0 commit comments

Comments
 (0)