231120 release to main ( v3.1.2 ) #557
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
# This is a basic workflow to help you get started with Actions | |
name: Lint | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
lint: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v13.1 | |
# Runs a set of commands using the runners shell | |
- name: Install Argo CLI | |
run: | | |
# Download the binary | |
curl -sLO https://github.com/argoproj/argo-workflows/releases/download/v3.2.6/argo-linux-amd64.gz | |
# Unzip | |
gunzip argo-linux-amd64.gz | |
# Make binary executable | |
chmod +x argo-linux-amd64 | |
# Move binary to path | |
mv ./argo-linux-amd64 /usr/local/bin/argo | |
# Test installation | |
argo version | |
# Make kubeconfig for executing argo cli | |
- name: Make kubeconfig | |
env: | |
CLUSTER_CA: ${{ secrets.TEST_CLUSTER_CA }} | |
CLUSTER_URL: ${{ secrets.TEST_CLUSTER_URL }} | |
run: | | |
cat <<EOF > /tmp/kubeconfig | |
apiVersion: v1 | |
clusters: | |
- cluster: | |
certificate-authority-data: $CLUSTER_CA | |
server: $CLUSTER_URL | |
name: tks-cicd | |
contexts: | |
- context: | |
cluster: tks-cicd | |
user: argo | |
name: argo@tks-cicd | |
current-context: argo@tks-cicd | |
kind: Config | |
preferences: {} | |
users: | |
- name: argo | |
user: | |
username: test | |
password: test | |
EOF | |
cat /tmp/kubeconfig | |
# Runs a Lint command | |
- name: Lint changed file | |
run: | | |
argo template lint --kubeconfig /tmp/kubeconfig ${{ steps.changed-files.outputs.all_changed_files }} |