Test improvements #130
Workflow file for this run
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: validate | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: '**' | |
jobs: | |
validate: | |
runs-on: ubuntu-latest | |
outputs: | |
drvpath: ${{ steps.test-derivation.outputs.drvpath }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: cachix/install-nix-action@v22 | |
with: | |
extra_nix_config: "system-features = nixos-test benchmark big-parallel kvm" | |
nix_path: nixpkgs=channel:nixos-23.11 | |
- name: build | |
run: NIXPKGS_ALLOW_UNFREE=1 nix build --impure | |
- name: set up test secret | |
run: | | |
mv ./tests/test-secret ./tests/test-secret.bak | |
echo -n "${{ secrets.NABALU_ENROLL_SECRET }}" | tee ./tests/test-secret | |
- name: check flake (runs tests) | |
run: NIXPKGS_ALLOW_UNFREE=1 nix flake check --impure --log-format internal-json | |
timeout-minutes: 15 | |
env: | |
CI: "true" | |
- name: get test derivation path | |
id: test-derivation | |
if: always() | |
run: | | |
drvpath=$(ls -d /nix/store/*-vm-test-run-kolide-launcher) | |
echo "drvpath=${drvpath}" >> "$GITHUB_OUTPUT" | |
- name: upload test screenshots | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: test-screenshots | |
path: ${{ steps.test-derivation.outputs.drvpath }}/test-*.png | |
retention-days: 1 | |
- name: show flake output attributes | |
run: nix flake show --impure | |
- name: show flake metadata | |
run: nix flake metadata | |
- name: launcher version | |
run: ./result/bin/launcher version | |
- name: osqueryd version | |
run: ./result/bin/osqueryd --version | |
- name: clean up after tests | |
if: always() | |
run: mv ./tests/test-secret.bak ./tests/test-secret |