summaryrefslogtreecommitdiff
path: root/.github/workflows/nix-test.yml
blob: 2a47656cd97158eec836ff78001485952454a8a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: Nix (Test)

on:
  workflow_call:
    secrets:
      CACHIX_AUTH_TOKEN:
        required: false

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: hyprwm/actions/nix-setup@main
        with:
          CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}

      - name: Run test VM
        run: nix build 'github:${{ github.repository }}?ref=${{ github.ref }}#checks.x86_64-linux.tests' -L --extra-substituters "https://hyprland.cachix.org"

      - name: Check exit status
        run: |
          grep 0 result/exit_status || echo "hyprtester failed"
          grep 0 result/exit_status_gtests || echo "gtests failed"
          [ 0 = $(cat result/exit_status) ] && [ 0 = $(cat result/exit_status_gtests) ]

      - name: Upload artifacts
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: logs
          path: result