forked from haskell/haskell-language-server
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (69 loc) · 2.17 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
68
69
70
71
72
73
74
75
76
77
name: Nix
# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency.
concurrency:
group: ${{ github.head_ref }}-${{ github.workflow }}
cancel-in-progress: true
on:
pull_request:
branches:
- '**'
push:
branches:
- master
jobs:
pre_job:
runs-on: ubuntu-latest
outputs:
should_skip_develop: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5.3.1
with:
cancel_others: false
paths_ignore: '[ "**/docs/**"
, "**.md"
, "**/LICENSE"
, ".circleci/**"
, "**/README.md"
, "FUNDING.yml"
, "**/stack*.yaml"
, "**/stack*.yaml"
, ".gitlab-ci.yaml"
, ".gitlab/**"
]'
# Enter the development shell and run `cabal build`
develop:
if: needs.pre_job.outputs.should_skip_develop != 'true'
needs: pre_job
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest]
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
experimental-features = nix-command flakes
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15
with:
name: haskell-language-server
authToken: ${{ secrets.HLS_CACHIX_AUTH_TOKEN }}
# Don't try and run the build (although that would be a good
# test), it takes a long time and we have sometimes had
# glibc incompatibilities with the runners
- run: |
nix develop --print-build-logs --command true
nix_post_job:
if: always()
runs-on: ubuntu-latest
needs: [pre_job, develop]
steps:
- run: |
echo "jobs info: ${{ toJSON(needs) }}"
- if: contains(needs.*.result, 'failure')
run: exit 1
- if: contains(needs.*.result, 'cancelled') && needs.pre_job.outputs.should_skip != 'true'
run: exit 1