-
-
Notifications
You must be signed in to change notification settings - Fork 391
Use cabal-install if nix is failing in CI #1859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c4a369b
Use cabal-install if nix is failing in CI
berberman c73c49f
Add default.nix
berberman 0f23617
Merge branch 'master' into nix-ci
berberman 41a8f09
Split nix job
berberman 6ae17f5
Merge branch 'nix-ci' of github.com:berberman/haskell-language-server…
berberman 20d2e9a
Fix syntax error
berberman 84dea75
Reorder
berberman f7923d1
Merge branch 'master' into nix-ci
berberman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,9 @@ on: | |
pull_request: | ||
branches: | ||
- '**' | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
pre_job: | ||
|
@@ -17,11 +20,10 @@ jobs: | |
cancel_others: true | ||
paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", ".circleci/**", "install/**"]' | ||
|
||
nix: | ||
# Enter the development shell and run `cabal build` | ||
develop: | ||
needs: pre_job | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
HAS_TOKEN: ${{ secrets.HLS_CACHIX_AUTH_TOKEN != '' }} | ||
|
||
strategy: | ||
fail-fast: false | ||
|
@@ -41,14 +43,43 @@ jobs: | |
extra_nix_config: | | ||
experimental-features = nix-command flakes | ||
nix_path: nixpkgs=channel:nixos-unstable | ||
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && env.HAS_TOKEN == 'true' }} | ||
uses: cachix/cachix-action@v8 | ||
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | ||
uses: cachix/cachix-action@v10 | ||
with: | ||
name: haskell-language-server | ||
authToken: ${{ secrets.HLS_CACHIX_AUTH_TOKEN }} | ||
# Disable pushing, we will do that in job `build` | ||
skipPush: true | ||
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | ||
run: nix build | ||
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && env.HAS_TOKEN == 'true' }} | ||
run: nix develop --profile dev && cachix push haskell-language-server dev | ||
- if: ${{ needs.pre_job.outputs.should_skip != 'true' && env.HAS_TOKEN == 'true' }} | ||
run: nix path-info --json | jq -r '.[].path' | cachix push haskell-language-server | ||
run: | | ||
nix develop --command cabal update | ||
nix develop --command cabal build | ||
|
||
# Build and then push HLS binaries with developmet shell to cachix | ||
# This job runs when PRs are merged to master, and should be excluded from branch protections | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
if: ${{ github.repository_owner == 'haskell' && github.ref == 'ref/heads/master' }} | ||
Comment on lines
+57
to
+61
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It didn't run as expected :( https://github.com/haskell/haskell-language-server/actions/runs/870310690 |
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macOS-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
- uses: cachix/install-nix-action@v13 | ||
with: | ||
install_url: https://nixos-nix-install-tests.cachix.org/serve/lb41az54kzk6j12p81br4bczary7m145/install | ||
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' | ||
extra_nix_config: | | ||
experimental-features = nix-command flakes | ||
nix_path: nixpkgs=channel:nixos-unstable | ||
- uses: cachix/cachix-action@v10 | ||
with: | ||
name: haskell-language-server | ||
authToken: ${{ secrets.HLS_CACHIX_AUTH_TOKEN }} | ||
- run: | | ||
nix develop --profile dev && cachix push haskell-language-server dev | ||
nix build | ||
nix path-info --json | jq -r '.[].path' | cachix push haskell-language-server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# This file is the compt layer of flakes: https://github.com/edolstra/flake-compat | ||
# See flake.nix for details | ||
(import ( | ||
let | ||
lock = builtins.fromJSON (builtins.readFile ./flake.lock); | ||
in fetchTarball { | ||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; | ||
sha256 = lock.nodes.flake-compat.locked.narHash; } | ||
) { | ||
src = ./.; | ||
}).defaultNix |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.