From fe75b716201a2d31bd8fe2531100e93ff7bfb4f1 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Wed, 28 Jun 2023 11:56:35 +0100 Subject: [PATCH] use nix caching and docker caching in CI Also bumps tailscale version to trigger build and fixes a CLI test that had the wrong capitalisation Signed-off-by: Kristoffer Dalby --- .github/workflows/build.yml | 4 +- .github/workflows/release.yml | 3 +- ...st-integration-v2-TestACLAllowStarDst.yaml | 8 ++- ...-integration-v2-TestACLAllowUser80Dst.yaml | 8 ++- ...st-integration-v2-TestACLAllowUserDst.yaml | 8 ++- ...t-integration-v2-TestACLDenyAllPort80.yaml | 8 ++- ...ion-v2-TestACLDevice1CanAccessDevice2.yaml | 8 ++- ...egration-v2-TestACLHostsInNetMapTable.yaml | 8 ++- ...egration-v2-TestACLNamedHostsCanReach.yaml | 8 ++- ...-v2-TestACLNamedHostsCanReachBySubnet.yaml | 8 ++- ...test-integration-v2-TestApiKeyCommand.yaml | 65 +++++++++++++++++++ ...ration-v2-TestAuthKeyLogoutAndRelogin.yaml | 8 ++- ...-TestAuthWebFlowAuthenticationPingAll.yaml | 8 ++- ...on-v2-TestAuthWebFlowLogoutAndRelogin.yaml | 8 ++- ...st-integration-v2-TestCreateTailscale.yaml | 8 ++- ...integration-v2-TestDERPServerScenario.yaml | 8 ++- ...est-integration-v2-TestEnablingRoutes.yaml | 8 ++- .../test-integration-v2-TestEphemeral.yaml | 8 ++- .../test-integration-v2-TestExpireNode.yaml | 8 ++- .../test-integration-v2-TestHeadscale.yaml | 8 ++- .../test-integration-v2-TestNodeCommand.yaml | 65 +++++++++++++++++++ ...-integration-v2-TestNodeExpireCommand.yaml | 65 +++++++++++++++++++ ...st-integration-v2-TestNodeMoveCommand.yaml | 65 +++++++++++++++++++ ...-integration-v2-TestNodeRenameCommand.yaml | 65 +++++++++++++++++++ ...est-integration-v2-TestNodeTagCommand.yaml | 65 +++++++++++++++++++ ...tion-v2-TestOIDCAuthenticationPingAll.yaml | 8 ++- ...TestOIDCExpireNodesBasedOnTokenExpiry.yaml | 8 ++- ...-integration-v2-TestPingAllByHostname.yaml | 8 ++- .../test-integration-v2-TestPingAllByIP.yaml | 8 ++- ...-integration-v2-TestPreAuthKeyCommand.yaml | 8 ++- ...estPreAuthKeyCommandReusableEphemeral.yaml | 8 ++- ...v2-TestPreAuthKeyCommandWithoutExpiry.yaml | 8 ++- ...st-integration-v2-TestResolveMagicDNS.yaml | 8 ++- ...-integration-v2-TestSSHIsBlockedInACL.yaml | 8 ++- ...ation-v2-TestSSHMultipleUsersAllToAll.yaml | 8 ++- ...integration-v2-TestSSHNoSSHConfigured.yaml | 8 ++- ...integration-v2-TestSSHOneUserAllToAll.yaml | 8 ++- ...ntegration-v2-TestSSUserOnlyIsolation.yaml | 8 ++- .../test-integration-v2-TestTaildrop.yaml | 8 ++- ...-v2-TestTailscaleNodesJoiningHeadcale.yaml | 8 ++- .../test-integration-v2-TestUserCommand.yaml | 8 ++- .github/workflows/test.yml | 4 +- cmd/gh-action-integration-generator/main.go | 8 ++- flake.nix | 2 +- go.mod | 10 +-- go.sum | 20 +++--- integration/cli_test.go | 2 +- 47 files changed, 585 insertions(+), 122 deletions(-) create mode 100644 .github/workflows/test-integration-v2-TestApiKeyCommand.yaml create mode 100644 .github/workflows/test-integration-v2-TestNodeCommand.yaml create mode 100644 .github/workflows/test-integration-v2-TestNodeExpireCommand.yaml create mode 100644 .github/workflows/test-integration-v2-TestNodeMoveCommand.yaml create mode 100644 .github/workflows/test-integration-v2-TestNodeRenameCommand.yaml create mode 100644 .github/workflows/test-integration-v2-TestNodeTagCommand.yaml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e1ba65a4..9d4b9925 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,7 +33,9 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v16 + - uses: DeterminateSystems/nix-installer-action@main + if: steps.changed-files.outputs.any_changed == 'true' + - uses: DeterminateSystems/magic-nix-cache-action@main if: steps.changed-files.outputs.any_changed == 'true' - name: Run build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4b048a32..72eddbcb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,8 @@ jobs: with: fetch-depth: 0 - - uses: cachix/install-nix-action@v16 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main - name: Run goreleaser run: nix develop --command -- goreleaser release --clean diff --git a/.github/workflows/test-integration-v2-TestACLAllowStarDst.yaml b/.github/workflows/test-integration-v2-TestACLAllowStarDst.yaml index 1a0487b0..304ea365 100644 --- a/.github/workflows/test-integration-v2-TestACLAllowStarDst.yaml +++ b/.github/workflows/test-integration-v2-TestACLAllowStarDst.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestACLAllowUser80Dst.yaml b/.github/workflows/test-integration-v2-TestACLAllowUser80Dst.yaml index 06e48b83..cfc58df9 100644 --- a/.github/workflows/test-integration-v2-TestACLAllowUser80Dst.yaml +++ b/.github/workflows/test-integration-v2-TestACLAllowUser80Dst.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestACLAllowUserDst.yaml b/.github/workflows/test-integration-v2-TestACLAllowUserDst.yaml index e78049b2..f0ed3d4f 100644 --- a/.github/workflows/test-integration-v2-TestACLAllowUserDst.yaml +++ b/.github/workflows/test-integration-v2-TestACLAllowUserDst.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestACLDenyAllPort80.yaml b/.github/workflows/test-integration-v2-TestACLDenyAllPort80.yaml index 79df71d5..7b0a9c37 100644 --- a/.github/workflows/test-integration-v2-TestACLDenyAllPort80.yaml +++ b/.github/workflows/test-integration-v2-TestACLDenyAllPort80.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestACLDevice1CanAccessDevice2.yaml b/.github/workflows/test-integration-v2-TestACLDevice1CanAccessDevice2.yaml index 8a36a2d2..7dd443c4 100644 --- a/.github/workflows/test-integration-v2-TestACLDevice1CanAccessDevice2.yaml +++ b/.github/workflows/test-integration-v2-TestACLDevice1CanAccessDevice2.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestACLHostsInNetMapTable.yaml b/.github/workflows/test-integration-v2-TestACLHostsInNetMapTable.yaml index c20cdf68..ab8b69b7 100644 --- a/.github/workflows/test-integration-v2-TestACLHostsInNetMapTable.yaml +++ b/.github/workflows/test-integration-v2-TestACLHostsInNetMapTable.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestACLNamedHostsCanReach.yaml b/.github/workflows/test-integration-v2-TestACLNamedHostsCanReach.yaml index d1e4c9d1..cdaa50dc 100644 --- a/.github/workflows/test-integration-v2-TestACLNamedHostsCanReach.yaml +++ b/.github/workflows/test-integration-v2-TestACLNamedHostsCanReach.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestACLNamedHostsCanReachBySubnet.yaml b/.github/workflows/test-integration-v2-TestACLNamedHostsCanReachBySubnet.yaml index 344ae518..c3214f40 100644 --- a/.github/workflows/test-integration-v2-TestACLNamedHostsCanReachBySubnet.yaml +++ b/.github/workflows/test-integration-v2-TestACLNamedHostsCanReachBySubnet.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestApiKeyCommand.yaml b/.github/workflows/test-integration-v2-TestApiKeyCommand.yaml new file mode 100644 index 00000000..1c526396 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestApiKeyCommand.yaml @@ -0,0 +1,65 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestApiKeyCommand + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run general integration tests + if: steps.changed-files.outputs.any_changed == 'true' + run: | + nix develop --command -- docker run \ + --tty --rm \ + --volume ~/.cache/hs-integration-go:/go \ + --name headscale-test-suite \ + --volume $PWD:$PWD -w $PWD/integration \ + --volume /var/run/docker.sock:/var/run/docker.sock \ + --volume $PWD/control_logs:/tmp/control \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -tags ts2019 \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestApiKeyCommand$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestAuthKeyLogoutAndRelogin.yaml b/.github/workflows/test-integration-v2-TestAuthKeyLogoutAndRelogin.yaml index 675f7dd0..f7cb31fe 100644 --- a/.github/workflows/test-integration-v2-TestAuthKeyLogoutAndRelogin.yaml +++ b/.github/workflows/test-integration-v2-TestAuthKeyLogoutAndRelogin.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestAuthWebFlowAuthenticationPingAll.yaml b/.github/workflows/test-integration-v2-TestAuthWebFlowAuthenticationPingAll.yaml index 984eb650..cb4415dd 100644 --- a/.github/workflows/test-integration-v2-TestAuthWebFlowAuthenticationPingAll.yaml +++ b/.github/workflows/test-integration-v2-TestAuthWebFlowAuthenticationPingAll.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestAuthWebFlowLogoutAndRelogin.yaml b/.github/workflows/test-integration-v2-TestAuthWebFlowLogoutAndRelogin.yaml index 47177d49..991b9c33 100644 --- a/.github/workflows/test-integration-v2-TestAuthWebFlowLogoutAndRelogin.yaml +++ b/.github/workflows/test-integration-v2-TestAuthWebFlowLogoutAndRelogin.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestCreateTailscale.yaml b/.github/workflows/test-integration-v2-TestCreateTailscale.yaml index 47a5157d..d01a9d54 100644 --- a/.github/workflows/test-integration-v2-TestCreateTailscale.yaml +++ b/.github/workflows/test-integration-v2-TestCreateTailscale.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestDERPServerScenario.yaml b/.github/workflows/test-integration-v2-TestDERPServerScenario.yaml index 0dfaeb75..06057663 100644 --- a/.github/workflows/test-integration-v2-TestDERPServerScenario.yaml +++ b/.github/workflows/test-integration-v2-TestDERPServerScenario.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestEnablingRoutes.yaml b/.github/workflows/test-integration-v2-TestEnablingRoutes.yaml index aeb86428..ff34f0c6 100644 --- a/.github/workflows/test-integration-v2-TestEnablingRoutes.yaml +++ b/.github/workflows/test-integration-v2-TestEnablingRoutes.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestEphemeral.yaml b/.github/workflows/test-integration-v2-TestEphemeral.yaml index e81e0937..5e046f71 100644 --- a/.github/workflows/test-integration-v2-TestEphemeral.yaml +++ b/.github/workflows/test-integration-v2-TestEphemeral.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestExpireNode.yaml b/.github/workflows/test-integration-v2-TestExpireNode.yaml index 80af2608..699599b1 100644 --- a/.github/workflows/test-integration-v2-TestExpireNode.yaml +++ b/.github/workflows/test-integration-v2-TestExpireNode.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestHeadscale.yaml b/.github/workflows/test-integration-v2-TestHeadscale.yaml index 52b562df..9a73ee1b 100644 --- a/.github/workflows/test-integration-v2-TestHeadscale.yaml +++ b/.github/workflows/test-integration-v2-TestHeadscale.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestNodeCommand.yaml b/.github/workflows/test-integration-v2-TestNodeCommand.yaml new file mode 100644 index 00000000..9fd84e1b --- /dev/null +++ b/.github/workflows/test-integration-v2-TestNodeCommand.yaml @@ -0,0 +1,65 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestNodeCommand + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run general integration tests + if: steps.changed-files.outputs.any_changed == 'true' + run: | + nix develop --command -- docker run \ + --tty --rm \ + --volume ~/.cache/hs-integration-go:/go \ + --name headscale-test-suite \ + --volume $PWD:$PWD -w $PWD/integration \ + --volume /var/run/docker.sock:/var/run/docker.sock \ + --volume $PWD/control_logs:/tmp/control \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -tags ts2019 \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestNodeCommand$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestNodeExpireCommand.yaml b/.github/workflows/test-integration-v2-TestNodeExpireCommand.yaml new file mode 100644 index 00000000..b6ebd22a --- /dev/null +++ b/.github/workflows/test-integration-v2-TestNodeExpireCommand.yaml @@ -0,0 +1,65 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestNodeExpireCommand + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run general integration tests + if: steps.changed-files.outputs.any_changed == 'true' + run: | + nix develop --command -- docker run \ + --tty --rm \ + --volume ~/.cache/hs-integration-go:/go \ + --name headscale-test-suite \ + --volume $PWD:$PWD -w $PWD/integration \ + --volume /var/run/docker.sock:/var/run/docker.sock \ + --volume $PWD/control_logs:/tmp/control \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -tags ts2019 \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestNodeExpireCommand$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestNodeMoveCommand.yaml b/.github/workflows/test-integration-v2-TestNodeMoveCommand.yaml new file mode 100644 index 00000000..29e1df91 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestNodeMoveCommand.yaml @@ -0,0 +1,65 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestNodeMoveCommand + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run general integration tests + if: steps.changed-files.outputs.any_changed == 'true' + run: | + nix develop --command -- docker run \ + --tty --rm \ + --volume ~/.cache/hs-integration-go:/go \ + --name headscale-test-suite \ + --volume $PWD:$PWD -w $PWD/integration \ + --volume /var/run/docker.sock:/var/run/docker.sock \ + --volume $PWD/control_logs:/tmp/control \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -tags ts2019 \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestNodeMoveCommand$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestNodeRenameCommand.yaml b/.github/workflows/test-integration-v2-TestNodeRenameCommand.yaml new file mode 100644 index 00000000..7acc923d --- /dev/null +++ b/.github/workflows/test-integration-v2-TestNodeRenameCommand.yaml @@ -0,0 +1,65 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestNodeRenameCommand + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run general integration tests + if: steps.changed-files.outputs.any_changed == 'true' + run: | + nix develop --command -- docker run \ + --tty --rm \ + --volume ~/.cache/hs-integration-go:/go \ + --name headscale-test-suite \ + --volume $PWD:$PWD -w $PWD/integration \ + --volume /var/run/docker.sock:/var/run/docker.sock \ + --volume $PWD/control_logs:/tmp/control \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -tags ts2019 \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestNodeRenameCommand$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestNodeTagCommand.yaml b/.github/workflows/test-integration-v2-TestNodeTagCommand.yaml new file mode 100644 index 00000000..ae4f6861 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestNodeTagCommand.yaml @@ -0,0 +1,65 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestNodeTagCommand + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run general integration tests + if: steps.changed-files.outputs.any_changed == 'true' + run: | + nix develop --command -- docker run \ + --tty --rm \ + --volume ~/.cache/hs-integration-go:/go \ + --name headscale-test-suite \ + --volume $PWD:$PWD -w $PWD/integration \ + --volume /var/run/docker.sock:/var/run/docker.sock \ + --volume $PWD/control_logs:/tmp/control \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -tags ts2019 \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestNodeTagCommand$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestOIDCAuthenticationPingAll.yaml b/.github/workflows/test-integration-v2-TestOIDCAuthenticationPingAll.yaml index e9a4e1ca..2bf77baf 100644 --- a/.github/workflows/test-integration-v2-TestOIDCAuthenticationPingAll.yaml +++ b/.github/workflows/test-integration-v2-TestOIDCAuthenticationPingAll.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestOIDCExpireNodesBasedOnTokenExpiry.yaml b/.github/workflows/test-integration-v2-TestOIDCExpireNodesBasedOnTokenExpiry.yaml index f9068888..0310c26c 100644 --- a/.github/workflows/test-integration-v2-TestOIDCExpireNodesBasedOnTokenExpiry.yaml +++ b/.github/workflows/test-integration-v2-TestOIDCExpireNodesBasedOnTokenExpiry.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestPingAllByHostname.yaml b/.github/workflows/test-integration-v2-TestPingAllByHostname.yaml index 60e9fbaf..714cc7fb 100644 --- a/.github/workflows/test-integration-v2-TestPingAllByHostname.yaml +++ b/.github/workflows/test-integration-v2-TestPingAllByHostname.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestPingAllByIP.yaml b/.github/workflows/test-integration-v2-TestPingAllByIP.yaml index 05413e86..c9632903 100644 --- a/.github/workflows/test-integration-v2-TestPingAllByIP.yaml +++ b/.github/workflows/test-integration-v2-TestPingAllByIP.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestPreAuthKeyCommand.yaml b/.github/workflows/test-integration-v2-TestPreAuthKeyCommand.yaml index f828b51d..e3d23fba 100644 --- a/.github/workflows/test-integration-v2-TestPreAuthKeyCommand.yaml +++ b/.github/workflows/test-integration-v2-TestPreAuthKeyCommand.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestPreAuthKeyCommandReusableEphemeral.yaml b/.github/workflows/test-integration-v2-TestPreAuthKeyCommandReusableEphemeral.yaml index 2114bd89..3939b1c8 100644 --- a/.github/workflows/test-integration-v2-TestPreAuthKeyCommandReusableEphemeral.yaml +++ b/.github/workflows/test-integration-v2-TestPreAuthKeyCommandReusableEphemeral.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestPreAuthKeyCommandWithoutExpiry.yaml b/.github/workflows/test-integration-v2-TestPreAuthKeyCommandWithoutExpiry.yaml index 53cb3957..735e1b92 100644 --- a/.github/workflows/test-integration-v2-TestPreAuthKeyCommandWithoutExpiry.yaml +++ b/.github/workflows/test-integration-v2-TestPreAuthKeyCommandWithoutExpiry.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestResolveMagicDNS.yaml b/.github/workflows/test-integration-v2-TestResolveMagicDNS.yaml index ac2b0b92..c3794fc9 100644 --- a/.github/workflows/test-integration-v2-TestResolveMagicDNS.yaml +++ b/.github/workflows/test-integration-v2-TestResolveMagicDNS.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestSSHIsBlockedInACL.yaml b/.github/workflows/test-integration-v2-TestSSHIsBlockedInACL.yaml index 5ee979b4..35f72443 100644 --- a/.github/workflows/test-integration-v2-TestSSHIsBlockedInACL.yaml +++ b/.github/workflows/test-integration-v2-TestSSHIsBlockedInACL.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestSSHMultipleUsersAllToAll.yaml b/.github/workflows/test-integration-v2-TestSSHMultipleUsersAllToAll.yaml index bcc88863..d8132578 100644 --- a/.github/workflows/test-integration-v2-TestSSHMultipleUsersAllToAll.yaml +++ b/.github/workflows/test-integration-v2-TestSSHMultipleUsersAllToAll.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestSSHNoSSHConfigured.yaml b/.github/workflows/test-integration-v2-TestSSHNoSSHConfigured.yaml index bf641a0e..0df1403e 100644 --- a/.github/workflows/test-integration-v2-TestSSHNoSSHConfigured.yaml +++ b/.github/workflows/test-integration-v2-TestSSHNoSSHConfigured.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestSSHOneUserAllToAll.yaml b/.github/workflows/test-integration-v2-TestSSHOneUserAllToAll.yaml index d61378de..3ffd7830 100644 --- a/.github/workflows/test-integration-v2-TestSSHOneUserAllToAll.yaml +++ b/.github/workflows/test-integration-v2-TestSSHOneUserAllToAll.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestSSUserOnlyIsolation.yaml b/.github/workflows/test-integration-v2-TestSSUserOnlyIsolation.yaml index a40a3af0..a2e3eadf 100644 --- a/.github/workflows/test-integration-v2-TestSSUserOnlyIsolation.yaml +++ b/.github/workflows/test-integration-v2-TestSSUserOnlyIsolation.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestTaildrop.yaml b/.github/workflows/test-integration-v2-TestTaildrop.yaml index 1d6c2430..dd7bb7c8 100644 --- a/.github/workflows/test-integration-v2-TestTaildrop.yaml +++ b/.github/workflows/test-integration-v2-TestTaildrop.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestTailscaleNodesJoiningHeadcale.yaml b/.github/workflows/test-integration-v2-TestTailscaleNodesJoiningHeadcale.yaml index 941c2311..697200e5 100644 --- a/.github/workflows/test-integration-v2-TestTailscaleNodesJoiningHeadcale.yaml +++ b/.github/workflows/test-integration-v2-TestTailscaleNodesJoiningHeadcale.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test-integration-v2-TestUserCommand.yaml b/.github/workflows/test-integration-v2-TestUserCommand.yaml index 449512bf..80aec27d 100644 --- a/.github/workflows/test-integration-v2-TestUserCommand.yaml +++ b/.github/workflows/test-integration-v2-TestUserCommand.yaml @@ -18,6 +18,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -29,9 +34,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: ${{ env.ACT }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 17ee7158..c2700d17 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,9 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v16 + - uses: DeterminateSystems/nix-installer-action@main + if: steps.changed-files.outputs.any_changed == 'true' + - uses: DeterminateSystems/magic-nix-cache-action@main if: steps.changed-files.outputs.any_changed == 'true' - name: Run tests diff --git a/cmd/gh-action-integration-generator/main.go b/cmd/gh-action-integration-generator/main.go index 0b363b0c..55d9cb50 100644 --- a/cmd/gh-action-integration-generator/main.go +++ b/cmd/gh-action-integration-generator/main.go @@ -39,6 +39,11 @@ jobs: with: fetch-depth: 2 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v34 @@ -50,9 +55,6 @@ jobs: integration_test/ config-example.yaml - - uses: cachix/install-nix-action@v18 - if: {{ "${{ env.ACT }}" }} || steps.changed-files.outputs.any_changed == 'true' - - name: Run general integration tests if: steps.changed-files.outputs.any_changed == 'true' run: | diff --git a/flake.nix b/flake.nix index 61939588..11fdbb47 100644 --- a/flake.nix +++ b/flake.nix @@ -33,7 +33,7 @@ # When updating go.mod or go.sum, a new sha will need to be calculated, # update this if you have a mismatch after doing a change to thos files. - vendorSha256 = "sha256-VEB8Bp4E4XWtIqPrMbtpzntbLxe5rd7nClj2PL1hZB4="; + vendorSha256 = "sha256-9Hol8w8HB28AlulshMYYQwOgvGzR47qxzyPrB8G0XSQ="; ldflags = ["-s" "-w" "-X github.com/juanfont/headscale/cmd/headscale/cli.Version=v${version}"]; }; diff --git a/go.mod b/go.mod index ef38a9ec..21070015 100644 --- a/go.mod +++ b/go.mod @@ -34,7 +34,7 @@ require ( github.com/tcnksm/go-latest v0.0.0-20170313132115-e3007ae9052e go4.org/netipx v0.0.0-20230303233057-f1b76eb4bb35 golang.org/x/crypto v0.8.0 - golang.org/x/net v0.9.0 + golang.org/x/net v0.10.0 golang.org/x/oauth2 v0.7.0 golang.org/x/sync v0.2.0 google.golang.org/genproto v0.0.0-20230403163135-c38d8f061ccd @@ -44,7 +44,7 @@ require ( gopkg.in/yaml.v3 v3.0.1 gorm.io/driver/postgres v1.4.8 gorm.io/gorm v1.24.6 - tailscale.com v1.42.0 + tailscale.com v1.44.0 ) require ( @@ -133,11 +133,11 @@ require ( go4.org/mem v0.0.0-20220726221520-4f986261bf13 // indirect golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 // indirect golang.org/x/mod v0.10.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/term v0.7.0 // indirect + golang.org/x/sys v0.8.1-0.20230609144347-5059a07aa46a // indirect + golang.org/x/term v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.8.0 // indirect + golang.org/x/tools v0.9.1 // indirect golang.zx2c4.com/wireguard/windows v0.5.3 // indirect google.golang.org/appengine v1.6.7 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/go.sum b/go.sum index 4e076796..e5aaa15c 100644 --- a/go.sum +++ b/go.sum @@ -597,8 +597,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -689,8 +689,8 @@ golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.1-0.20230131160137-e7d7f63158de/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.1-0.20230609144347-5059a07aa46a h1:qMsju+PNttu/NMbq8bQ9waDdxgJMu9QNoUDuhnBaYt0= +golang.org/x/sys v0.8.1-0.20230609144347-5059a07aa46a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY= @@ -698,8 +698,8 @@ golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuX golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ= -golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= +golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -768,8 +768,8 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.8.0 h1:vSDcovVPld282ceKgDimkRSC8kpaH1dgyc9UMzlt84Y= -golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= +golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= +golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -924,5 +924,5 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= software.sslmate.com/src/go-pkcs12 v0.2.0 h1:nlFkj7bTysH6VkC4fGphtjXRbezREPgrHuJG20hBGPE= -tailscale.com v1.42.0 h1:TlbYJIq/PCuHywD9nTEq/wD1pAoULX7Gc9sdYvngz20= -tailscale.com v1.42.0/go.mod h1:6WD9//Juq/UWwV9Pfpfqo1/n0t59U6MBrhZLVLip1zw= +tailscale.com v1.44.0 h1:MPos9n30kJvdyfL52045gVFyNg93K+bwgDsr8gqKq2o= +tailscale.com v1.44.0/go.mod h1:+iYwTdeHyVJuNDu42Zafwihq1Uqfh+pW7pRaY1GD328= diff --git a/integration/cli_test.go b/integration/cli_test.go index 039b065a..d4525883 100644 --- a/integration/cli_test.go +++ b/integration/cli_test.go @@ -1473,7 +1473,7 @@ func TestNodeMoveCommand(t *testing.T) { assert.Contains( t, moveToNonExistingNSResult, - "User not found", + "user not found", ) assert.Equal(t, machine.User.Name, "new-user")