Exercise Nix build in workflow (#46)

This commit is contained in:
Patrick Stevens
2022-12-27 20:50:54 +00:00
committed by GitHub
parent dbf3d75ee4
commit e834694466
6 changed files with 695 additions and 115 deletions

View File

@@ -38,14 +38,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Install Nix
uses: cachix/install-nix-action@v17
- name: Build
run: nix build
- name: Run app
run: dotnet run --project AdventOfCode2022.App/AdventOfCode2022.App.fsproj --configuration Release
run: ./result/bin/AdventOfCode2022.App
check-format:
check-dotnet-format:
runs-on: ubuntu-latest
steps:
- name: Checkout
@@ -59,13 +59,26 @@ jobs:
- name: Run Fantomas
run: ./hooks/pre-push
check-nix-format:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v17
- name: Run Alejandra
run: nix develop --command alejandra --check .
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v17
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
run: nix shell 'nixpkgs#shellcheck' --command bash -c "find . -type f -name '*.sh' | xargs shellcheck"
linkcheck:
name: Check links
@@ -76,7 +89,7 @@ jobs:
name: Run link checker
all-required-checks-complete:
needs: [check-format, build, shellcheck, linkcheck, run-app]
needs: [check-dotnet-format, check-nix-format, build, shellcheck, linkcheck, run-app]
runs-on: ubuntu-latest
steps:
- run: echo "All required checks complete."