nh/.github/workflows/test.yaml
dependabot[bot] 011fe3c9af
ci: bump actions/checkout from 5 to 6 (#476)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-22 14:50:46 +00:00

75 lines
1.7 KiB
YAML

name: "Test NH"
on:
workflow_dispatch:
pull_request:
paths:
- "Cargo.toml"
- "Cargo.lock"
- "xtask/Cargo.toml"
- "src/**"
- "xtask/src/**"
- ".cargo/**"
- ".github/workflows/build.yaml"
push:
branches-ignore:
- "update-*"
paths:
- "Cargo.toml"
- "Cargo.lock"
- "xtask/Cargo.toml"
- "src/**"
- "xtask/src/**"
- ".cargo/**"
- ".github/workflows/build.yaml"
jobs:
test-linux:
name: "Test NH on Linux"
runs-on: ubuntu-latest
steps:
- uses: cachix/install-nix-action@master
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
nix_path: nixpkgs=channel:nixos-unstable
- uses: actions/checkout@v6
- name: Run Tests
run: |
set -x
# Verify that tests pass
nix develop --command cargo test
- name: Test Switching to NixOS Configuration
run: |
nix run .#nh -- os switch --diff never --dry --no-nom --verbose --file ./test/nixos.nix
build-darwin:
name: "Test NH on Darwin"
runs-on: macos-latest
steps:
- uses: cachix/install-nix-action@master
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v6
- name: Run Tests
run: |
set -x
# Verify that tests pass
nix develop --command cargo test
- name: Test Switching to Nix Darwin Configuration
run: |
mkdir flake
cd flake
nix flake init -t nix-darwin
git add flake.nix
cd ..
nix run .#nh -- darwin switch --diff never --hostname simple --dry --no-nom --verbose ./flake