Samsung/WSL2 #748
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 and test flake outputs | |
on: | |
push: | |
workflow_dispatch: | |
workflow_call: | |
inputs: | |
branch: | |
description: Branch name to build on | |
default: "" | |
required: false | |
type: string | |
secrets: | |
CACHIX_ACTIVATE_TOKEN: | |
CACHIX_AUTH_TOKEN: | |
required: true | |
jobs: | |
nix: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
system: | |
- aarch64 | |
nix-command: | |
- eval .#apps.$_system.nixos-shell.program | |
- eval .#apps.$_system.setup.program | |
- develop .#rust --impure | |
include: | |
- nix-command: build .#nixOnDroidConfigurations.sams9.activationPackage --impure --print-build-logs --log-lines 9999 --accept-flake-config | |
system: aarch64 | |
deploy-agent: sams9 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ inputs.branch }} | |
- name: Free Disk Space (Ubuntu) | |
uses: jlumbroso/free-disk-space@main | |
continue-on-error: true | |
with: | |
tool-cache: true | |
- name: Install qemu-user-static | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: sudo apt-get install -y qemu-user-static | |
- name: Install nix | |
uses: cachix/install-nix-action@v22 | |
with: | |
extra_nix_config: | | |
keep-going = true | |
show-trace = true | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
system = aarch64-linux # enables binfmt on that machine, see https://nixos.wiki/wiki/NixOS_on_ARM#Compiling_through_binfmt_QEMU | |
- name: Cache | |
uses: DeterminateSystems/magic-nix-cache-action@main | |
with: | |
upstream-cache: https://573-bc.cachix.org | |
- name: Setup cachix | |
uses: cachix/cachix-action@v12 | |
with: | |
name: 573-bc | |
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | |
- name: Test entry | |
run: | | |
echo "::group::Show token is set" | |
if [ $( grep github /etc/nix/nix.conf | wc -l ) -gt 0 ]; then echo "github set"; else echo "github not set"; fi | |
- name: Build command (aarch64) | |
if: matrix.system == 'aarch64' | |
env: | |
_system: ${{ matrix.system }}-linux | |
run: | | |
cachix use gerschtli | |
cachix use nix-on-droid | |
cachix use 573-bc | |
cachix use nix-community | |
cachix use tweag-jupyter | |
cachix use coq | |
cachix use nixpkgs-ruby | |
cachix use arm | |
echo "::group::Build command" | |
nix ${{ matrix.nix-command }} | |
- name: Deploy cachix-agent spec (aarch64) | |
if: github.ref == 'refs/heads/wsl2' && matrix.deploy-agent | |
env: | |
CACHIX_ACTIVATE_TOKEN: ${{ secrets.CACHIX_ACTIVATE_TOKEN }} | |
run: | | |
echo "::group::Build spec" | |
spec="$(nix build --print-out-paths ".#cachix-deploy-spec-${{ matrix.deploy-agent }}" --impure)" | |
echo "::group::Upload spec" | |
cachix push 573-bc "$spec" | |
# vim: set sw=2: |