aboutsummaryrefslogtreecommitdiffhomepage
path: root/.gitea/workflows/test.yml
blob: 0ca93ab1a415f9ae14303e3d07ea735fbaaf611a (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Test

on:
  - push
  - pull_request

jobs:
  fortify:
    name: Fortify
    runs-on: nix
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Run NixOS test
        run: nix build --out-link "result" --print-out-paths --print-build-logs .#checks.x86_64-linux.fortify

      - name: Upload test output
        uses: actions/upload-artifact@v3
        with:
          name: "fortify-vm-output"
          path: result/*
          retention-days: 1

  fpkg:
    name: Fpkg
    runs-on: nix
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Run NixOS test
        run: nix build --out-link "result" --print-out-paths --print-build-logs .#checks.x86_64-linux.fpkg

      - name: Upload test output
        uses: actions/upload-artifact@v3
        with:
          name: "fpkg-vm-output"
          path: result/*
          retention-days: 1

  race:
    name: Data race detector
    runs-on: nix
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Run NixOS test
        run: nix build --out-link "result" --print-out-paths --print-build-logs .#checks.x86_64-linux.race

      - name: Upload test output
        uses: actions/upload-artifact@v3
        with:
          name: "fortify-race-vm-output"
          path: result/*
          retention-days: 1

  check:
    name: Flake checks
    needs:
      - fortify
      - fpkg
      - race
    runs-on: nix
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Run checks
        run: nix --print-build-logs --experimental-features 'nix-command flakes' flake check

  dist:
    name: Create distribution
    runs-on: nix
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Build for test
        id: build-test
        run: >-
          export FORTIFY_REV="$(git rev-parse --short HEAD)" &&
          sed -i.old 's/version = /version = "0.0.0-'$FORTIFY_REV'"; # version = /' package.nix &&
          nix build --print-out-paths --print-build-logs .#dist &&
          mv package.nix.old package.nix &&
          echo "rev=$FORTIFY_REV" >> $GITHUB_OUTPUT

      - name: Upload test build
        uses: actions/upload-artifact@v3
        with:
          name: "fortify-${{ steps.build-test.outputs.rev }}"
          path: result/*
          retention-days: 1