|
| 1 | +name: integration-legacy |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + |
| 8 | +concurrency: |
| 9 | + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 10 | + cancel-in-progress: true |
| 11 | + |
| 12 | +permissions: |
| 13 | + contents: read |
| 14 | + |
| 15 | +# A small number of integration tests cannot run as hermetic NixOS-VM checks |
| 16 | +# because they need Tailscale's public DERP relays (real internet) — see |
| 17 | +# excludedFromNixChecks in gh-action-integration-generator.go. They run here the |
| 18 | +# legacy way, via cmd/hi against Dockerfile-built images, which also keeps the |
| 19 | +# cmd/hi path and the integration Dockerfiles exercised in CI. The matrix is the |
| 20 | +# generated integration/excluded-tests.json so this list has a single source. |
| 21 | +jobs: |
| 22 | + list: |
| 23 | + runs-on: ubuntu-latest |
| 24 | + outputs: |
| 25 | + tests: ${{ steps.list.outputs.tests }} |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
| 28 | + - id: list |
| 29 | + run: echo "tests=$(jq -c . integration/excluded-tests.json)" >> "$GITHUB_OUTPUT" |
| 30 | + |
| 31 | + test: |
| 32 | + needs: list |
| 33 | + runs-on: ubuntu-latest |
| 34 | + strategy: |
| 35 | + fail-fast: false |
| 36 | + matrix: |
| 37 | + test: ${{ fromJSON(needs.list.outputs.tests) }} |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
| 40 | + - uses: NixOS/nix-installer-action@6b8548fe06acfb0155a50ab5d561accb215764cc # main |
| 41 | + - uses: Mic92/hestia/action@ff07bb902a9968ac0c3d0e51d90a606662a375d8 # main |
| 42 | + |
| 43 | + # Docker 29's default containerd snapshotter regresses these images; the |
| 44 | + # classic overlay2 graph driver is the known-good path (mirrors the VM checks). |
| 45 | + - name: Force overlay2 storage driver |
| 46 | + run: | |
| 47 | + sudo mkdir -p /etc/docker |
| 48 | + echo '{"storage-driver":"overlay2"}' | sudo tee /etc/docker/daemon.json |
| 49 | + sudo systemctl restart docker |
| 50 | +
|
| 51 | + - name: Login to Docker Hub |
| 52 | + env: |
| 53 | + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_CI_USERNAME }} |
| 54 | + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_CI_TOKEN }} |
| 55 | + if: env.DOCKERHUB_USERNAME != '' |
| 56 | + uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 |
| 57 | + with: |
| 58 | + username: ${{ env.DOCKERHUB_USERNAME }} |
| 59 | + password: ${{ env.DOCKERHUB_TOKEN }} |
| 60 | + |
| 61 | + # cmd/hi requires prebuilt head images in CI (util.IsCI); released versions |
| 62 | + # pull from the registry and tailscale-rs is built inline by tsric. |
| 63 | + # Dockerfile.integration-ci COPYs a prebuilt headscale binary from the |
| 64 | + # build context, so build it first (tailscale-HEAD builds from source). |
| 65 | + - name: Build headscale + tailscale-HEAD images |
| 66 | + run: | |
| 67 | + nix develop --command bash -c 'CGO_ENABLED=0 GOOS=linux go build -o headscale ./cmd/headscale' |
| 68 | + docker build --file Dockerfile.integration-ci --tag headscale:ci . |
| 69 | + docker build --file Dockerfile.tailscale-HEAD --tag tailscale-head:ci . |
| 70 | +
|
| 71 | + - name: Run ${{ matrix.test }} |
| 72 | + env: |
| 73 | + HEADSCALE_INTEGRATION_HEADSCALE_IMAGE: headscale:ci |
| 74 | + HEADSCALE_INTEGRATION_TAILSCALE_IMAGE: tailscale-head:ci |
| 75 | + run: nix develop --command go run ./cmd/hi run "^${{ matrix.test }}$" --timeout=900s |
0 commit comments