18
18
runs-on : ubuntu-latest
19
19
outputs :
20
20
should_skip_develop : ${{ steps.skip_check.outputs.should_skip }}
21
- should_skip_build : ${{ steps.skip_check_no_nix.outputs.should_skip }}
22
21
steps :
23
22
- id : skip_check
24
23
35
34
, ".gitlab-ci.yaml"
36
35
, ".gitlab/**"
37
36
]'
38
- - id : skip_check_no_nix
39
-
40
- with :
41
- cancel_others : false
42
- paths : ' [ "**.nix" ]'
43
37
44
38
# Enter the development shell and run `cabal build`
45
39
develop :
@@ -63,66 +57,15 @@ jobs:
63
57
- uses : cachix/cachix-action@v12
64
58
with :
65
59
name : haskell-language-server
66
- # Disable pushing, we will do that in job `build`
67
- skipPush : true
60
+ authToken : ${{ secrets.HLS_CACHIX_AUTH_TOKEN }}
68
61
- run : |
69
62
nix develop --print-build-logs --command cabal update
70
63
nix develop --print-build-logs --command cabal build
71
64
72
- # Build and then push HLS binaries with developmet shell to cachix
73
- # This job runs when
74
- # 1. PRs are merged to master (runs on master)
75
- # 2. Nix files are changed (runs on PR)
76
- build :
77
- needs : pre_job
78
- runs-on : ${{ matrix.os }}
79
- env :
80
- HAS_TOKEN : ${{ secrets.HLS_CACHIX_AUTH_TOKEN != '' }}
81
- if : (needs.pre_job.outputs.should_skip_build != 'true' && needs.pre_job.outputs.should_skip_pr != 'true') || (github.repository_owner == 'haskell' && github.ref == 'refs/heads/master')
82
- strategy :
83
- fail-fast : false
84
- matrix :
85
- os : [ubuntu-latest, macOS-latest]
86
-
87
- steps :
88
- - uses : actions/checkout@v3
89
-
90
- - uses : cachix/install-nix-action@v23
91
- with :
92
- extra_nix_config : |
93
- experimental-features = nix-command flakes
94
- nix_path : nixpkgs=channel:nixos-unstable
95
- - uses : cachix/cachix-action@v12
96
- with :
97
- name : haskell-language-server
98
- authToken : ${{ secrets.HLS_CACHIX_AUTH_TOKEN }}
99
- - name : Build development shell
100
- run : nix develop --print-build-logs --profile dev
101
- - name : Build all development shell (without nix dependencies)
102
- run : nix develop --print-build-logs .#all-simple-dev-shells --profile dev
103
- # We only build nix dev shell for current GHC version because some are
104
- # failing with different GHC version on darwin.
105
- - name : Build development shell with nix dependencies for current GHC version
106
- if : matrix.os == 'macOS-latest'
107
- run : nix develop --print-build-logs .#haskell-language-server-dev-nix --profile dev
108
- - name : Build development shells with nix dependencies
109
- if : matrix.os == 'ubuntu-latest'
110
- run : nix develop --print-build-logs .#all-nix-dev-shells --profile dev
111
- - name : Push development shell
112
- if : ${{ env.HAS_TOKEN == 'true' }}
113
- run : cachix push haskell-language-server dev
114
- - name : Build binaries
115
- run : nix build --print-build-logs
116
- - name : Build all binaries
117
- run : nix build --print-build-logs .#all-haskell-language-server
118
- - name : Push binaries
119
- if : ${{ env.HAS_TOKEN == 'true' }}
120
- run : nix path-info --json | jq -r '.[].path' | cachix push haskell-language-server
121
-
122
65
nix_post_job :
123
66
if : always()
124
67
runs-on : ubuntu-latest
125
- needs : [pre_job, develop, build ]
68
+ needs : [pre_job, develop]
126
69
steps :
127
70
- run : |
128
71
echo "jobs info: ${{ toJSON(needs) }}"
0 commit comments