This repository has been archived on 2024-07-08. You can view files and clone it, but cannot push or open issues or pull requests.
nix-config-tn/.forgejo/workflows/build.yml

50 lines
1.5 KiB
YAML
Raw Normal View History

2024-05-20 10:29:02 -05:00
name: "Build"
on:
pull_request:
jobs:
nix-build:
if: github.event.pull_request.draft == false
strategy:
fail-fast: false
matrix:
include:
- system: varda
2024-05-21 13:19:54 -05:00
os: native-aarch64
2024-05-20 10:29:02 -05:00
- system: durincore
2024-05-26 12:47:33 -05:00
os: native-x86_64
2024-05-20 21:46:57 -05:00
runs-on: ${{ matrix.os }}
2024-05-21 13:49:24 -05:00
env:
PATH: ${{ format('{0}:{1}', '/run/current-system/sw/bin', env.PATH) }}
2024-05-20 10:29:02 -05:00
steps:
- name: Checkout repository
uses: https://github.com/actions/checkout@v4
with:
fetch-depth: 0
- uses: https://github.com/cachix/cachix-action@v15
2024-05-20 22:29:57 -05:00
if: ${{ !github.event.pull_request.head.repo.fork }}
with:
name: hsndev
# If you chose API tokens for write access OR if you have a private cache
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
2024-05-21 13:49:24 -05:00
# env:
# USER: 'root'
2024-05-20 10:29:02 -05:00
2024-05-20 22:29:57 -05:00
- name: Garbage collect build dependencies
run: nix-collect-garbage
2024-05-20 10:29:02 -05:00
2024-05-20 22:29:57 -05:00
- name: Build new ${{ matrix.system }} system
2024-05-21 09:13:36 -05:00
shell: bash
2024-05-20 22:29:57 -05:00
run: |
set -o pipefail
nix build \
".#top.${{ matrix.system }}" \
--profile ./profile \
--fallback \
-v \
--log-format raw \
2024-05-26 17:16:42 -05:00
> >(tee stdout.log) 2> >(tee /tmp/nix-build-err.log >&2)
- name: Push to Cachix
if: success()
2024-05-26 17:27:32 -05:00
env:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
2024-05-26 17:16:42 -05:00
run: nix build ".#top.${{ matrix.system }}" --json | jq -r .[].drvPath | cachix push hsndev