build(nix): add haqq flake app; add l5, allnodes and p2p seeds; prepare flake for nixos-search; self-hosted runners #859
This file contains 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
name: Build | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
cleanup-runs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: rokroskar/workflow-run-cleanup-action@master | |
env: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'" | |
build: | |
runs-on: [self-hosted, ubuntu] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.20' | |
- uses: technote-space/get-diff-action@v5 | |
id: git_diff | |
with: | |
SUFFIX_FILTER: | | |
.go | |
.mod | |
.sum | |
- name: Pull LFS files | |
run: git lfs pull | |
- run: | | |
make build | |
if: "env.GIT_DIFF != ''" | |
build-nix: | |
strategy: | |
matrix: | |
runner: [nix, macos-latest] | |
runs-on: ${{ matrix.runner }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: haqq-network/nix-action@master | |
if: ${{ matrix.runner == 'macos-latest' }} | |
with: | |
installNix: true | |
useCachix: false | |
- name: Build nix package | |
env: | |
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }} | |
run: | | |
nix build .#haqq --print-build-logs | |
nix build --json \ | |
| jq -r '.[].outputs | to_entries[].value' \ | |
| nix run nixpkgs#cachix push haqq | |
check-nix: | |
runs-on: [self-hosted, nix] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check if nix package and Makefile versions match | |
run: | | |
nix develop --impure .#ci --command ci-check-version | |
- name: Check if gomod2nix is up to date | |
run: | | |
nix develop --impure .#ci --command ci-check-gomod2nix | |
# GLIBC problems when executing it on nixos 23.11 | |
# - name: Check nixos-search validity | |
# run: | | |
# nix run nixos-search -- --json flake . |