1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00
nix-darwin/.github/workflows/test.yml
Daiderd Jordan d2bbe72e18
use current branch as darwin input for flakes
Overriding the registry was supposed to handle this but it seems the
behaviour changed at some point or never worked as intended if an url is
defined for the input.
2021-09-15 20:10:56 +02:00

60 lines
2.1 KiB
YAML

name: "Test"
on:
pull_request:
push:
jobs:
tests:
runs-on: macos-10.15
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v12
- run: nix-build ./release.nix -I nixpkgs=channel:nixpkgs-20.09-darwin -I darwin=. -A tests
- run: nix-build ./release.nix -I nixpkgs=channel:nixpkgs-20.09-darwin -I darwin=. -A manpages
- run: nix-build ./release.nix -I nixpkgs=channel:nixpkgs-20.09-darwin -I darwin=. -A examples.simple
install:
runs-on: macos-10.15
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v12
- run: |
nix-channel --add https://nixos.org/channels/nixpkgs-20.09-darwin nixpkgs
nix-channel --update
- run: |
export NIX_PATH=$HOME/.nix-defexpr/channels
nix-shell -A installer
nix-shell -A installer.check
- run: |
. /etc/static/bashrc
darwin-rebuild switch -I darwin=.
- run: |
export NIX_PATH=$HOME/.nix-defexpr/channels
nix-shell -A uninstaller
nix-shell -A uninstaller.check
install-flake:
runs-on: macos-10.15
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: cachix/install-nix-action@v12
with:
install_url: https://github.com/numtide/nix-flakes-installer/releases/download/nix-2.4pre20210207_fd6eaa1/install
extra_nix_config: |
experimental-features = nix-command flakes
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- run: |
nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs
nix-channel --update
- run: |
export NIX_PATH=$HOME/.nix-defexpr/channels
nix-shell -A installer
- run: |
nix build ./modules/examples#darwinConfigurations.simple.system --override-input darwin .
- run: |
./result/sw/bin/darwin-rebuild switch --flake ./modules/examples#simple --override-input darwin .
- run: |
. /etc/static/bashrc
darwin-rebuild build --flake ./modules/examples#simple --override-input darwin .