summaryrefslogtreecommitdiffhomepage
path: root/.github/workflows/natlab-integrationtest.yml
blob: 6c0d4957543c33544aced3b7eb8faa58a3a4db66 (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
# Run some natlab integration tests.
# See https://github.com/tailscale/tailscale/issues/13038
name: "natlab-integrationtest"

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

on:
  push:
    branches:
      - "main"
      - "release-branch/*"
  pull_request:
    # all PRs on all branches
  merge_group:
    branches:
      - "main"
jobs:
  natlab-integrationtest:
    runs-on: ubuntu-latest
    steps:
      - name: Check out code
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
      - name: Enable KVM
        run: |
          echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
          sudo udevadm control --reload-rules
          sudo udevadm trigger --name-match=kvm
      - name: Install qemu
        run: |
          sudo rm -f /var/lib/man-db/auto-update
          sudo apt-get -y update
          sudo apt-get -y remove man-db
          sudo apt-get install -y qemu-system-x86 qemu-utils
      - name: Build VM image
        # The test will build this if missing, but we do it explicitly
        # to avoid cutting into the go test -timeout budget, and to
        # fail earlier with a clearer error if the image build breaks.
        run: |
          make -C gokrazy natlab
      - name: Run natlab integration tests
        run: |
          ./tool/go test -v -run=^TestEasyEasy$ -timeout=3m -count=1 ./tstest/integration/nat  --run-vm-tests