-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (56 loc) · 1.66 KB
/
nix.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: CI
on:
push:
branches:
- master
pull_request_target:
workflow_dispatch:
jobs:
nix:
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macOS-latest
ghc:
- "9.4.8"
steps:
# https://github.com/dependabot/dependabot-core/issues/3253#issuecomment-799466911
- uses: actions/checkout@v4
if: ${{ github.event_name == 'pull_request_target' }}
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@v4
if: ${{ github.event_name != 'pull_request_target' }}
- name: Free disk space (Ubuntu only)
if: runner.os == 'Linux'
uses: jlumbroso/free-disk-space@main
- name: Set nix path
id: nix-path
run: |
echo ::set-output name=nixpkgs::$(jq -r .nixpkgs.url ./nix/sources.json)
- uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=${{ steps.nix-path.outputs.nixpkgs }}
extra_nix_config: |
log-lines = 1000
# - uses: cachix/cachix-action@v12
# with:
# name: nixkell
# authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Nix Shell
run: |
nix-shell --run "echo OK"
- name: Check code formatting
if: ${{runner.os == 'Linux'}}
run: |
nix-shell --run "treefmt --fail-on-change"
- name: Build
run: |
nix-build ./nix/release.nix --argstr compiler ${{ matrix.ghc }}
- name: Run
run: |
result/bin/nixkell