mirror of
https://github.com/kubernetes-sigs/kind.git
synced 2025-11-30 23:16:04 +07:00
Clean up GitHub Action definitions
This defines a local action for the common actions performed by most of our workflows. This reduces duplication between them to make sure they are consistent, and also make the workflow definitions more concise to just the operations that are unique to the particular testing activities. Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
34
.github/actions/setup-env/action.yaml
vendored
Normal file
34
.github/actions/setup-env/action.yaml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
name: "Setup environment"
|
||||
description: "Performs common setup operations."
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Get go version
|
||||
id: golangversion
|
||||
run: |
|
||||
echo "go_version=$(cat .go-version)" >> "$GITHUB_OUTPUT"
|
||||
shell: bash
|
||||
|
||||
- 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
|
||||
26
.github/workflows/docker.yaml
vendored
26
.github/workflows/docker.yaml
vendored
@@ -28,31 +28,7 @@ jobs:
|
||||
- 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' }}
|
||||
|
||||
28
.github/workflows/nerdctl.yaml
vendored
28
.github/workflows/nerdctl.yaml
vendored
@@ -31,34 +31,8 @@ jobs:
|
||||
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: |
|
||||
|
||||
28
.github/workflows/podman.yml
vendored
28
.github/workflows/podman.yml
vendored
@@ -31,34 +31,8 @@ jobs:
|
||||
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: |
|
||||
|
||||
2
.github/workflows/vm.yaml
vendored
2
.github/workflows/vm.yaml
vendored
@@ -14,7 +14,7 @@ permissions:
|
||||
jobs:
|
||||
vm:
|
||||
# Fedora is different from Ubuntu in LSM (SELinux), filesystem (btrfs), kernel version, etc.
|
||||
name: "VM (Fedora)"
|
||||
name: "CGroupv2 (Fedora)"
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
|
||||
Reference in New Issue
Block a user