Skip to content

Commit

Permalink
Merge pull request #53 from yokawasa/add-arch-type
Browse files Browse the repository at this point in the history
Support arch type
  • Loading branch information
yokawasa committed Feb 24, 2024
2 parents 93f6df1 + e651ff0 commit 2e3262f
Show file tree
Hide file tree
Showing 5 changed files with 238 additions and 127 deletions.
69 changes: 58 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
- run: |
kubectl version --client
kustomize version
helm version --client
helm version
kubeval --version
kubeconform -v
Expand All @@ -41,7 +40,6 @@ jobs:
kubectl=${{steps.setup.outputs.kubectl-path}}
kustomize=${{steps.setup.outputs.kustomize-path}}
helm=${{steps.setup.outputs.helm-path}}
helmv2=${{steps.setup.outputs.helmv2-path}}
kubeval=${{steps.setup.outputs.kubeval-path}}
kubeconform=${{steps.setup.outputs.kubeconform-path}}
conftest=${{steps.setup.outputs.conftest-path}}
Expand All @@ -54,7 +52,6 @@ jobs:
${kubectl} version --client
${kustomize} version
${helm} version
${helmv2} version --client
${kubeval} --version
${kubeconform} -v
${conftest} --version
Expand All @@ -73,7 +70,6 @@ jobs:
kubectl: '1.17.1'
kustomize: '3.7.0'
helm: '3.2.4'
helmv2: '2.16.7'
kubeval: '0.16.1'
kubeconform: '0.5.0'
conftest: '0.18.2'
Expand All @@ -87,7 +83,6 @@ jobs:
kubectl version --client
kustomize version
helm version
helmv2 version --client
kubeval --version
kubeconform -v
conftest --version
Expand All @@ -100,7 +95,6 @@ jobs:
kubectl=${{steps.setup.outputs.kubectl-path}}
kustomize=${{steps.setup.outputs.kustomize-path}}
helm=${{steps.setup.outputs.helm-path}}
helmv2=${{steps.setup.outputs.helmv2-path}}
kubeval=${{steps.setup.outputs.kubeval-path}}
kubeconform=${{steps.setup.outputs.kubeconform-path}}
conftest=${{steps.setup.outputs.conftest-path}}
Expand All @@ -113,7 +107,6 @@ jobs:
${kubectl} version --client
${kustomize} version
${helm} version
${helmv2} version --client
${kubeval} --version
${kubeconform} -v
${conftest} --version
Expand All @@ -129,6 +122,7 @@ jobs:
- uses: actions/checkout@v4
- uses: ./
with:
arch-type: 'amd64'
setup-tools: |
kubectl
helm
Expand All @@ -148,7 +142,6 @@ jobs:
kubectl=${{steps.setup.outputs.kubectl-path}}
kustomize=${{steps.setup.outputs.kustomize-path}}
helm=${{steps.setup.outputs.helm-path}}
helmv2=${{steps.setup.outputs.helmv2-path}}
kubeval=${{steps.setup.outputs.kubeval-path}}
kubeconform=${{steps.setup.outputs.kubeconform-path}}
conftest=${{steps.setup.outputs.conftest-path}}
Expand All @@ -167,9 +160,6 @@ jobs:
if [ ! -z ${helm} ]; then
${helm} version
fi
if [ ! -z ${helmv2} ]; then
${helmv2} version --client
fi
if [ ! -z ${kubeval} ]; then
${kubeval} --version
fi
Expand All @@ -194,3 +184,60 @@ jobs:
if [ ! -z ${kubescore} ]; then
${kubescore} version
fi
# ARM test
test4:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
arch-type: 'arm64'
id: setup
- run: |
kubectl=${{steps.setup.outputs.kubectl-path}}
kustomize=${{steps.setup.outputs.kustomize-path}}
helm=${{steps.setup.outputs.helm-path}}
kubeval=${{steps.setup.outputs.kubeval-path}}
kubeconform=${{steps.setup.outputs.kubeconform-path}}
conftest=${{steps.setup.outputs.conftest-path}}
yq=${{steps.setup.outputs.yq-path}}
rancher=${{steps.setup.outputs.rancher-path}}
tilt=${{steps.setup.outputs.tilt-path}}
skaffold=${{steps.setup.outputs.skaffold-path}}
kubescore=${{steps.setup.outputs.kube-score-path}}
if [ ! -z ${kubectl} ]; then
file ${kubectl}
fi
if [ ! -z ${kustomize} ]; then
file ${kustomize}
fi
if [ ! -z ${helm} ]; then
file ${helm}
fi
if [ ! -z ${kubeval} ]; then
file ${kubeval}
fi
if [ ! -z ${kubeconform} ]; then
file ${kubeconform}
fi
if [ ! -z ${conftest} ]; then
file ${conftest}
fi
if [ ! -z ${yq} ]; then
file ${yq}
fi
if [ ! -z ${rancher} ]; then
file ${rancher}
fi
if [ ! -z ${tilt} ]; then
file ${tilt}
fi
if [ ! -z ${skaffold} ]; then
file ${skaffold}
fi
if [ ! -z ${kubescore} ]; then
file ${kubescore}
fi
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ A GitHub Action that setup Kubernetes tools (kubectl, kustomize, helm, kubeconfo
|Parameter|Required|Default Value|Description|
|:--:|:--:|:--:|:--|
|`fail-fast`|`false`|`true`| the action immediately fails when it fails to download (ie. due to a bad version) |
|`arch-type`|`false`|`amd64`| The processor architecture type of the tool binary to setup. Supported types are only `amd64` and `arm64`. If a type other than the supported Types is specified, it will be treated as `amd64`.|
|`setup-tools`|`false`|`""`|List of tool name to setup. By default, the action download and setup all supported Kubernetes tools. By specifying `setup-tools` you can choose which tools the action setup. Supported separator is `return` in multi-line string. Supported tools are `kubectl`, `kustomize`, `helm`, `helmv3`, `kubeval`, `conftest`, `yq`, `rancher`, `tilt`, `skaffold`, `kube-score`|
|`kubectl`|`false`|`1.24.10`| kubectl version. kubectl vesion can be found [here](https://github.com/kubernetes/kubernetes/releases)|
|`kustomize`|`false`|`5.0.0`| kustomize version. kustomize vesion can be found [here](https://github.com/kubernetes-sigs/kustomize/releases)|
|`helm`|`false`|`3.11.1`| helm v3 version. helm vesion can be found [here](https://github.com/helm/helm/releases)|
|`helmv2`|`false`|`2.17.0`| helm v2 version. helm v3 vesion can be found [here](https://github.com/helm/helm/releases)|
|`helm`|`false`|`3.11.1`| helm version. helm vesion can be found [here](https://github.com/helm/helm/releases)|
|`kubeval`|`false`|`0.16.1`| kubeval version (must be **0.16.1+**). kubeval vesion can be found [here](https://github.com/instrumenta/kubeval/releases).<br> NOTE: this parameter is deprecating as `kubeval` is no longer maintained. A good replacement is [kubeconform](https://github.com/yannh/kubeconform). See also [this](https://github.com/instrumenta/kubeval) for more details.|
|`kubeconform`|`false`|`0.5.0`| kubeconform version. kubeconform vesion can be found [here](https://github.com/yannh/kubeconform/releases)|
|`conftest`|`false`|`0.39.0`| conftest version. conftest vesion can be found [here](https://github.com/open-policy-agent/conftest/releases)|
Expand All @@ -33,7 +33,6 @@ A GitHub Action that setup Kubernetes tools (kubectl, kustomize, helm, kubeconfo
|`kubectl-path`| kubectl command path if the action setup the tool, otherwise empty string |
|`kustomize-path`| kustomize command path if the action setup the tool, otherwise empty string |
|`helm-path`| helm command path if the action setup the tool, otherwise empty string |
|`helmv2-path`| helm v2 command path if the action setup the tool, otherwise empty string |
|`kubeval-path`| kubeval command path if the action setup the tool, otherwise empty string |
|`kubeconform-path`| kubeconform command path if the action setup the tool, otherwise empty string |
|`conftest-path`| conftest command path if the action setup the tool, otherwise empty string |
Expand All @@ -57,7 +56,6 @@ Specific versions for the commands can be setup by adding inputs parameters like
kubectl: '1.17.1'
kustomize: '3.7.0'
helm: '3.5.2'
helmv2: '2.16.7'
kubeconform: '0.5.0'
conftest: '0.18.2'
rancher: '2.4.10'
Expand All @@ -68,7 +66,6 @@ Specific versions for the commands can be setup by adding inputs parameters like
kubectl version --client
kustomize version
helm version
helmv2 version --client
kubeconform -v
conftest --version
yq --version
Expand All @@ -90,7 +87,6 @@ Default versions for the commands will be setup if you don't give any inputs lik
kubectl version --client
kustomize version
helm version
helmv2 version --client
kubeconform -v
conftest --version
yq --version
Expand Down
12 changes: 5 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ inputs:
required: false
default: 'true'
description: 'the action immediately fails when it fails to download (ie. due to a bad version)'
arch-type:
required: false
default: 'amd64'
description: 'The processor architecture type of the tool binary to setup. Supported types are only "amd64" and "arm64". If a type other than the supported Types is specified, it will be treated as "amd64"'
setup-tools:
required: false
default: ''
Expand All @@ -21,11 +25,7 @@ inputs:
helm:
required: false
default: '3.11.1'
description: 'helm v3 version'
helmv2:
required: false
default: '2.17.0'
description: 'helm v2 version'
description: 'helm version'
kubeval:
required: false
default: '0.16.1'
Expand Down Expand Up @@ -65,8 +65,6 @@ outputs:
description: 'kustomize command path if the action setup the tool, otherwise empty string'
helm-path:
description: 'helm command path if the action setup the tool, otherwise empty string'
helmv2-path:
description: 'helmv2 command path if the action setup the tool, otherwise empty string'
kubeval-path:
description: 'kubeval command path if the action setup the tool, otherwise empty string'
conftest-path:
Expand Down
Loading

0 comments on commit 2e3262f

Please sign in to comment.