4
4
pull_request :
5
5
branches :
6
6
- ' **'
7
+ push :
8
+ branches :
9
+ - master
7
10
8
11
jobs :
9
12
pre_job :
@@ -17,11 +20,10 @@ jobs:
17
20
cancel_others : true
18
21
paths_ignore : ' ["**/docs/**", "**.md", "**/LICENSE", ".circleci/**", "install/**"]'
19
22
20
- nix :
23
+ # Enter the development shell and run `cabal build`
24
+ develop :
21
25
needs : pre_job
22
26
runs-on : ${{ matrix.os }}
23
- env :
24
- HAS_TOKEN : ${{ secrets.HLS_CACHIX_AUTH_TOKEN != '' }}
25
27
26
28
strategy :
27
29
fail-fast : false
@@ -41,14 +43,43 @@ jobs:
41
43
extra_nix_config : |
42
44
experimental-features = nix-command flakes
43
45
nix_path : nixpkgs=channel:nixos-unstable
44
- - if : ${{ needs.pre_job.outputs.should_skip != 'true' && env.HAS_TOKEN == 'true' }}
45
- uses : cachix/cachix-action@v8
46
+ - if : ${{ needs.pre_job.outputs.should_skip != 'true' }}
47
+ uses : cachix/cachix-action@v10
46
48
with :
47
49
name : haskell-language-server
48
- authToken : ${{ secrets.HLS_CACHIX_AUTH_TOKEN }}
50
+ # Disable pushing, we will do that in job `build`
51
+ skipPush : true
49
52
- if : ${{ needs.pre_job.outputs.should_skip != 'true' }}
50
- run : nix build
51
- - if : ${{ needs.pre_job.outputs.should_skip != 'true' && env.HAS_TOKEN == 'true' }}
52
- run : nix develop --profile dev && cachix push haskell-language-server dev
53
- - if : ${{ needs.pre_job.outputs.should_skip != 'true' && env.HAS_TOKEN == 'true' }}
54
- run : nix path-info --json | jq -r '.[].path' | cachix push haskell-language-server
53
+ run : |
54
+ nix develop --command cabal update
55
+ nix develop --command cabal build
56
+
57
+ # Build and then push HLS binaries with developmet shell to cachix
58
+ # This job runs when PRs are merged to master, and should be excluded from branch protections
59
+ build :
60
+ runs-on : ${{ matrix.os }}
61
+ if : ${{ github.repository_owner == 'haskell' && github.ref == 'ref/heads/master' }}
62
+ strategy :
63
+ fail-fast : false
64
+ matrix :
65
+ os : [ubuntu-latest, macOS-latest]
66
+
67
+ steps :
68
+ - uses : actions/checkout@v2
69
+ with :
70
+ submodules : true
71
+ - uses : cachix/install-nix-action@v13
72
+ with :
73
+ install_url : https://nixos-nix-install-tests.cachix.org/serve/lb41az54kzk6j12p81br4bczary7m145/install
74
+ install_options : ' --tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
75
+ extra_nix_config : |
76
+ experimental-features = nix-command flakes
77
+ nix_path : nixpkgs=channel:nixos-unstable
78
+ - uses : cachix/cachix-action@v10
79
+ with :
80
+ name : haskell-language-server
81
+ authToken : ${{ secrets.HLS_CACHIX_AUTH_TOKEN }}
82
+ - run : |
83
+ nix develop --profile dev && cachix push haskell-language-server dev
84
+ nix build
85
+ nix path-info --json | jq -r '.[].path' | cachix push haskell-language-server
0 commit comments