mirror of
https://github.com/dwinkler1/np.git
synced 2026-02-19 22:40:57 -05:00
check on pr
This commit is contained in:
parent
782fd3037f
commit
91b3a388e7
2 changed files with 41 additions and 1 deletions
4
.github/workflows/check.yml
vendored
4
.github/workflows/check.yml
vendored
|
|
@ -1,7 +1,6 @@
|
||||||
name: "Test template"
|
name: "Test template"
|
||||||
on:
|
on:
|
||||||
workflow_dispatch: # allows manual triggering
|
workflow_dispatch: # allows manual triggering
|
||||||
pull_request:
|
|
||||||
push:
|
push:
|
||||||
jobs:
|
jobs:
|
||||||
tests:
|
tests:
|
||||||
|
|
@ -11,6 +10,9 @@ jobs:
|
||||||
os: [ubuntu-latest]
|
os: [ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- uses: wimpysworld/nothing-but-nix@main
|
||||||
|
with:
|
||||||
|
️hatchet-protocol: 'carve'
|
||||||
- uses: cachix/install-nix-action@v31
|
- uses: cachix/install-nix-action@v31
|
||||||
with:
|
with:
|
||||||
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
|
||||||
38
.github/workflows/check_pr.yml
vendored
Normal file
38
.github/workflows/check_pr.yml
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
name: "Test template PR"
|
||||||
|
on:
|
||||||
|
workflow_dispatch: # allows manual triggering
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened]
|
||||||
|
pull_request_target:
|
||||||
|
types: [opened, synchronize, reopened]
|
||||||
|
jobs:
|
||||||
|
tests:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- uses: wimpysworld/nothing-but-nix@main
|
||||||
|
with:
|
||||||
|
️hatchet-protocol: 'carve'
|
||||||
|
- uses: cachix/install-nix-action@v31
|
||||||
|
with:
|
||||||
|
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- uses: DeterminateSystems/magic-nix-cache-action@main
|
||||||
|
- run: nix build ./templates/n
|
||||||
|
- run: nix flake check ./templates/n
|
||||||
|
- name: Comment on PR (if tests fail)
|
||||||
|
if: failure()
|
||||||
|
uses: actions/github-script@main
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
github.rest.issues.createComment({
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
body: '❌ Tests failed on this pull request. Please check the workflow logs for details.'
|
||||||
|
})
|
||||||
Loading…
Add table
Add a link
Reference in a new issue