diff --git a/.github/workflows/test-workflows.yaml b/.github/workflows/test-workflows.yaml new file mode 100644 index 000000000..449996410 --- /dev/null +++ b/.github/workflows/test-workflows.yaml @@ -0,0 +1,42 @@ +name: Lint Workflow Templates + +on: + push: + branches: + - main + pull_request: + +jobs: + lint-workflow-templates: + runs-on: ubuntu-latest + + steps: + - name: Checkout latest changes from the PR branch + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: Set up Kind cluster with Helm + uses: helm/kind-action@v1.10.0 + with: + cluster_name: argo-lint-cluster + + - name: Helm Install Argo + run: | + helm repo add argo https://argoproj.github.io/argo-helm + helm repo update + kubectl create namespace argo + helm install argo argo/argo-workflows --namespace argo + + - name: Install Argo CLI + run: | + curl -sLO https://github.com/argoproj/argo-workflows/releases/latest/download/argo-linux-amd64.gz + gunzip argo-linux-amd64.gz + chmod +x argo-linux-amd64 + sudo mv argo-linux-amd64 /usr/local/bin/argo + argo version + + - name: Argo Lint Workflow Template + run: | + for file in workflows/argo-events/workflowtemplates/*.yaml; do + echo "Linting workflow template: $file" + argo lint $file + done