diff --git a/.github/actions/setup-env/action.yaml b/.github/actions/setup-env/action.yaml new file mode 100644 index 0000000000..a266120e20 --- /dev/null +++ b/.github/actions/setup-env/action.yaml @@ -0,0 +1,36 @@ +name: "Setup environment" +description: "Performs common setup operations." +runs: + using: "composite" + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + + - name: Get go version + id: golangversion + run: | + echo "go_version=$(cat .go-version)" >> "$GITHUB_OUTPUT" + + - name: Set up Go + id: go + uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 + with: + go-version: ${{ steps.golangversion.outputs.go_version }} + check-latest: true + + - name: Install kind + run: sudo make install INSTALL_DIR=/usr/local/bin + shell: bash + + - name: Install kubectl + run: | + curl -LO https://dl.k8s.io/release/$(curl -sL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl + chmod +x ./kubectl + sudo mv ./kubectl /usr/local/bin/kubectl + shell: bash + + - name: Enable ipv4 and ipv6 forwarding + run: | + sudo sysctl -w net.ipv6.conf.all.forwarding=1 + sudo sysctl -w net.ipv4.ip_forward=1 + shell: bash diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 1b7872c037..a2f12290be 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -25,34 +25,7 @@ jobs: JOB_NAME: "docker-${{ matrix.deployment }}-${{ matrix.ipFamily }}" IP_FAMILY: ${{ matrix.ipFamily }} steps: - - name: Check out code into the Go module directory - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - - - name: Get go version - id: golangversion - run: | - echo "go_version=$(cat .go-version)" >> "$GITHUB_OUTPUT" - - - name: Set up Go - id: go - uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 - with: - go-version: ${{ steps.golangversion.outputs.go_version }} - check-latest: true - - - name: Install kind - run: sudo make install INSTALL_DIR=/usr/local/bin - - - name: Install kubectl - run: | - curl -LO https://dl.k8s.io/release/$(curl -sL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl - chmod +x ./kubectl - sudo mv ./kubectl /usr/local/bin/kubectl - - - name: Enable ipv4 and ipv6 forwarding - run: | - sudo sysctl -w net.ipv6.conf.all.forwarding=1 - sudo sysctl -w net.ipv4.ip_forward=1 + - uses: ./.github/actions/setup-env - name: Create single node cluster if: ${{ matrix.deployment == 'singleNode' }} diff --git a/.github/workflows/nerdctl.yaml b/.github/workflows/nerdctl.yaml index 32476891f3..a657960e98 100644 --- a/.github/workflows/nerdctl.yaml +++ b/.github/workflows/nerdctl.yaml @@ -29,36 +29,7 @@ jobs: NERDCTL_VERSION: "1.7.4" KIND_EXPERIMENTAL_PROVIDER: "nerdctl" steps: - - name: Check out code into the Go module directory - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - with: - fetch-depth: 0 - - - name: Get go version - id: golangversion - run: | - echo "go_version=$(cat .go-version)" >> "$GITHUB_OUTPUT" - - - name: Set up Go - id: go - uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 - with: - go-version: ${{ steps.golangversion.outputs.go_version }} - check-latest: true - - - name: Install kind - run: sudo make install INSTALL_DIR=/usr/local/bin - - - name: Install kubectl - run: | - curl -LO https://dl.k8s.io/release/$(curl -sL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl - chmod +x ./kubectl - sudo mv ./kubectl /usr/local/bin/kubectl - - - name: Enable ipv4 and ipv6 forwarding - run: | - sudo sysctl -w net.ipv6.conf.all.forwarding=1 - sudo sysctl -w net.ipv4.ip_forward=1 + - uses: ./.github/actions/setup-env - name: Install nerdctl run: | diff --git a/.github/workflows/podman.yml b/.github/workflows/podman.yml index 7f5d37d3ff..70aea51f47 100644 --- a/.github/workflows/podman.yml +++ b/.github/workflows/podman.yml @@ -29,36 +29,7 @@ jobs: IP_FAMILY: ${{ matrix.ipFamily }} PODMAN_VERSION: "stable" steps: - - name: Check out code into the Go module directory - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - with: - fetch-depth: 0 - - - name: Get go version - id: golangversion - run: | - echo "go_version=$(cat .go-version)" >> "$GITHUB_OUTPUT" - - - name: Set up Go - id: go - uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 - with: - go-version: ${{ steps.golangversion.outputs.go_version }} - check-latest: true - - - name: Install kind - run: sudo make install INSTALL_DIR=/usr/local/bin - - - name: Install kubectl - run: | - curl -LO https://dl.k8s.io/release/$(curl -sL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl - chmod +x ./kubectl - sudo mv ./kubectl /usr/local/bin/kubectl - - - name: Enable ipv4 and ipv6 forwarding - run: | - sudo sysctl -w net.ipv6.conf.all.forwarding=1 - sudo sysctl -w net.ipv4.ip_forward=1 + - uses: ./.github/actions/setup-env - name: Setup podman run: | diff --git a/.github/workflows/vm.yaml b/.github/workflows/vm.yaml index 1b74eb703f..f176a7c63c 100644 --- a/.github/workflows/vm.yaml +++ b/.github/workflows/vm.yaml @@ -1,4 +1,4 @@ -name: VM +name: CGroupv2 on: workflow_dispatch: