generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Test Actions | ||
|
||
on: | ||
pull_request: | ||
push: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Create kwok cluster | ||
uses: ./actions/create-cluster # kubernetes-sigs/kwok/actions/create-cluster@main | ||
- name: Test kwokctl | ||
shell: bash | ||
run: kubectl --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Create kwok cluster | ||
|
||
description: This action creates a kwok cluster | ||
|
||
inputs: | ||
kube-version: | ||
required: false | ||
description: Kubernetes version to use | ||
cluster-name: | ||
required: false | ||
description: Name of the cluster to create | ||
default: kwok | ||
kwok-version: | ||
required: false | ||
description: KWOK version to use | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Create kwok cluster | ||
uses: ./actions/kwok | ||
with: | ||
command: kwokctl | ||
args: create cluster --name ${{ inputs.cluster-name }} | ||
kwok-version: ${{ inputs.kwok-version }} | ||
env: | ||
KWOK_KUBE_VERSION: ${{ inputs.kube-version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: kwok | ||
|
||
description: This action runs kwok | ||
|
||
inputs: | ||
args: | ||
required: true | ||
description: Arguments passed to `kwok` or `kwokctl` | ||
kwok-version: | ||
required: false | ||
description: KWOK version to use | ||
command: | ||
required: false | ||
description: Command to run | ||
default: kwok | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Install and start kwok | ||
shell: bash | ||
env: | ||
KWOK_REPO: ${{ github.repository }} | ||
KWOK_VERSION: ${{ inputs.kwok-version }} | ||
run: | | ||
if [[ -z "${KWOK_VERSION}" ]]; then | ||
echo "Fetching latest version..." | ||
KWOK_VERSION="$(curl "https://api.github.com/repos/${KWOK_REPO}/releases/latest" | jq -r '.tag_name')" | ||
fi | ||
BIN_PATH="~/.kwok/bin/${{ inputs.command }}-${KWOK_VERSION}" | ||
if [[ ! -f "${BIN_PATH}" ]]; then | ||
echo "Installing ${{ inputs.command }} ${KWOK_VERSION}..." | ||
mkdir -p ~/.kwok/bin/ | ||
curl -o "${BIN_PATH}" "https://github.com/${KWOK_REPO}/releases/download/${KWOK_VERSION}/${{ inputs.command }}-$(go env GOOS)-$(go env GOARCH)" | ||
chmod +x "${BIN_PATH}" | ||
fi | ||
echo "Running ${{ inputs.command }} ${{ inputs.args }}" | ||
"${BIN_PATH}" ${{ inputs.args }} |