Skip to content

Chore: Optimize resource (#43) #189

Chore: Optimize resource (#43)

Chore: Optimize resource (#43) #189

Workflow file for this run

name: main
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
branches:
- master
workflow_dispatch:
env:
K8S_IGNORE_LINT: 'application\|project\|istio\|kong\|elastic\|kibana\|loadbalancer\|values'
TERRAFORM_COMMAND: 'terraform -chdir=./terraform'
jobs:
kubernetes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Glob kubernetes yaml
run: |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "YAML_LIST<<$EOF" >> "$GITHUB_ENV"
ls -1Rd kubernetes/*/*.yaml | grep -v ${K8S_IGNORE_LINT} >> "$GITHUB_ENV"
echo "$EOF" >> "$GITHUB_ENV"
- name: kubernetes lint
uses: azure/k8s-lint@v1
with:
manifests: |
${{ env.YAML_LIST }}
packer:
runs-on: ubuntu-latest
container: hashicorp/packer:1.9
steps:
- uses: actions/checkout@v3
- name: Run `packer init`
id: init
run: "cd packer && packer init ."
- name: Run `packer validate`
id: validate
run: "cd packer && packer validate ."
terraform:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Init
run: ${TERRAFORM_COMMAND} init
- name: Linting
run: ${TERRAFORM_COMMAND} fmt -recursive -check
- name: Validate
run: ${TERRAFORM_COMMAND} validate
tflint:
runs-on: ubuntu-latest
needs: terraform
steps:
- uses: actions/checkout@v3
name: Checkout source code
- uses: terraform-linters/setup-tflint@v3
name: Setup TFLint
with:
tflint_version: v0.44.1
- name: Init TFLint
run: tflint --init
- name: Run TFLint
run: tflint --chdir=./terraform -f compact