Skip to content

Update zyclonite/zerotier Docker tag to v1.14.2 #443

Update zyclonite/zerotier Docker tag to v1.14.2

Update zyclonite/zerotier Docker tag to v1.14.2 #443

Workflow file for this run

name: Lint and Test Charts
on:
push:
branches:
- '*'
- '!main'
pull_request:
paths:
- 'charts/**'
jobs:
lint:
name: Lint charts
runs-on: ubuntu-latest
# strategy:
# matrix:
# k8s:
# - v1.16.8
# - v1.17.4
# - v1.18.20
# - v1.19.16
# - v1.20.15
# - v1.21.10
# - v1.22.7
# - v1.23.4
# - v1.24.14
# - v1.25.10
# - v1.26.5
# - v1.27.2
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.11.2
- uses: actions/setup-python@v5
with:
python-version: '3.9'
check-latest: true
- name: Set up chart-testing
uses: helm/[email protected]
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch main)
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --target-branch main
- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/[email protected]
# with:
# kubectl_version: ${{ matrix.k8s }}
- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: |
ct install --target-branch main --excluded-charts cloudflared
- name: Show kubernetes resources (debug)
if: steps.list-changed.outputs.changed == 'true' || failure()
run: |
kubectl get pods --all-namespaces
kubectl get pvc --all-namespaces
kubectl get pv --all-namespaces
prepare-tests:
name: Prepare tests
needs: lint
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.11.2
- uses: actions/setup-python@v5
with:
python-version: '3.9'
check-latest: true
- name: Set up chart-testing
uses: helm/[email protected]
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch main)
if [[ -n "$changed" ]]; then
echo "changedCharts=$changed" >> "$GITHUB_OUTPUT"
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Set matrix for build
id: set-matrix
run: |
# See https://stackoverflow.com/a/62953566/11948346
CHARTS="${{ steps.list-changed.outputs.changedCharts }}"
JSON="{\"include\":["
# Loop by lines
while read chart; do
# Set $os. "ubuntu-latest" by default.
os="ubuntu-latest"
# Add build to the matrix only if it is not already included
JSONline="{\"directory\": \"$chart\", \"os\": \"$os\"},"
if [[ "$JSON" != *"$JSONline"* ]]; then
JSON="$JSON$JSONline"
fi
done <<< "$CHARTS"
# Remove last "," and add closing brackets
if [[ $JSON == *, ]]; then
JSON="${JSON%?}"
fi
JSON="$JSON]}"
echo $JSON
# Set output
echo "matrix=$( echo "$JSON" )" >> $GITHUB_OUTPUT
test:
name: Test "${{ matrix.directory }}"
needs: prepare-tests
runs-on: ${{ matrix.os }}
strategy:
matrix: ${{fromJson(needs.prepare-tests.outputs.matrix)}}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Sops Binary Installer
uses: mdgreenwald/[email protected]
id: install
- name: Decrypt secrets
run: |
sops --output-type json --decrypt test/tunnel-credentials.json.enc > test/tunnel-credentials.json
env:
SOPS_AGE_KEY: ${{ secrets.SOPS_AGE_KEY }}
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.11.2
- uses: actions/setup-python@v5
with:
python-version: '3.9'
check-latest: true
- name: Set up chart-testing
uses: helm/[email protected]
- name: Setup Docker
uses: docker/setup-buildx-action@v3
- name: Install KinD Kubernetes
uses: helm/[email protected]
with:
install_only: true
- uses: zufardhiyaulhaq/[email protected]
with:
version: 1.17.2
- name: Run bats tests
run: |
./test/helpers/bats/bin/bats ${{ matrix.directory }}/test/test.bats --print-output-on-failure