Skip to content

Samsung/WSL2

Samsung/WSL2 #728

Workflow file for this run

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
include:
- nix-command: build .#nixOnDroidConfigurations.sams9.activationPackage --impure --print-build-logs --log-lines 9999 --accept-flake-config
system: aarch64
deploy-agent: sams9
deploy-args: --async
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ inputs.branch }}
- name: Install qemu-user-static
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: Setup cachix
uses: cachix/cachix-action@v12
with:
name: 573-bc
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- 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: |
format(
'
echo "::group::Build spec"
spec="$(run nix build --print-out-paths ".#cachix-deploy-spec-{0}" --impure)"
echo "::group::Upload spec"
cachix push 573-bc "$spec"
',
matrix.deploy-agent,
matrix.deploy-args
)
|| 'echo "::group::Skip spec deploy"'
# vim: set sw=2: