Fix nix build and evaluate nix on all branches (#463)

* Evaluate nix on all branches

* Fix nix build
This commit is contained in:
Tim Süberkrüb 2025-01-23 12:55:27 +01:00 committed by GitHub
parent 2fcf3e4cec
commit b8d17e4bd6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 5 deletions

View file

@ -1,9 +1,12 @@
name: Check nix code
on:
workflow_dispatch:
# We run this pipeline on all branches, but perform the time-intesive steps only on main
push:
branches:
- 'main'
branches: [ '**' ]
pull_request:
branches: [ '**' ]
workflow_dispatch:
permissions:
contents: read
@ -25,12 +28,20 @@ jobs:
with:
name: polarity
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
# Step that runs on all branches
- name: Evaluate nix code
run: nix -Lv flake check
# Time-intensive steps only run on the main branch
- name: Build and run polarity using nix
if: ${{ github.ref == 'refs/heads/main' }}
run: nix -Lv run .# -- --help
- name: Build and run a static polarity exe
if: matrix.os == 'ubuntu-latest'
if: ${{ github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest' }}
run: nix -Lv run .#polarity-static -- --help
- name: Drop into nix devshell and run tests
if: ${{ github.ref == 'refs/heads/main' }}
run: nix develop -Lv -c bash -c "make test"

View file

@ -7,7 +7,6 @@ rustPlatform.buildRustPackage rec {
cargoLock = {
lockFile = "${src}/Cargo.lock";
outputHashes = {
"codespan-0.11.1" = "sha256-0cUndjWQ44X5zXVfg7YX/asBByWq/hFV1n9tHPBTcfY=";
"tower-lsp-0.20.0" = "sha256-f3S2CyFFX6yylaxMoXhB1/bfizVsLfNldLM+dXl5Y8k=";
};
};