Skip to content

Commit

Permalink
feat: added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
exelban committed Jun 3, 2022
1 parent 676db77 commit fbe51cd
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
55 changes: 55 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: tests

on: [push]

jobs:
default-cmd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
curl --silent --fail https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash
k3d cluster delete testing
k3d cluster create testing
KUBECONFIG=$(k3d kubeconfig get testing | base64 | sed ':a;N;$!ba;s/\n//g')
echo "KUBE_CONFIG=${KUBECONFIG}" >> $GITHUB_ENV
- uses: ./
get-pods:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
curl --silent --fail https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash
k3d cluster delete testing
k3d cluster create testing
KUBECONFIG=$(k3d kubeconfig get testing | base64 | sed ':a;N;$!ba;s/\n//g')
echo "KUBE_CONFIG=${KUBECONFIG}" >> $GITHUB_ENV
- uses: ./
with:
args: get pods
multiply:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
curl --silent --fail https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash
k3d cluster delete testing
k3d cluster create testing
KUBECONFIG=$(k3d kubeconfig get testing | base64 | sed ':a;N;$!ba;s/\n//g')
echo "KUBE_CONFIG=${KUBECONFIG}" >> $GITHUB_ENV
- uses: ./
- uses: ./
with:
args: get pods
kustomize:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
echo 'configMapGenerator:
- name: example
literals:
- FOO=Bar' > kustomization.yaml
- uses: ./
with:
args: kustomize
2 changes: 1 addition & 1 deletion .github/workflows/upgrader.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Check if new version exist
id: check
run: |
SDK_VERSION=$(curl --silent "https://api.github.com/repos/kubernetes/kubernetes/releases" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sort -V -r | head -n 1)
SDK_VERSION=$(curl --silent "https://api.github.com/repos/kubernetes/kubernetes/releases" | jq '.[] | select(.prerelease==false) | .tag_name' | sort -V -r | head -n 1 | tr -d '"')
LATEST_VERSION=$(curl --silent "https://api.github.com/repos/actions-hub/kubectl/releases/latest" | tac | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
DOCKER_VERSION=$(cat $GITHUB_WORKSPACE/Dockerfile | grep "ARG KUBE_VERSION=" | sed -E 's/ARG KUBE_VERSION=//' | tr -d '"')
Expand Down

0 comments on commit fbe51cd

Please sign in to comment.