ci: add pre-commit, k8s and tflint action workflows

This commit is contained in:
cătălin 2024-08-04 02:22:11 +02:00
commit 399dd397bb
No known key found for this signature in database
5 changed files with 45 additions and 14 deletions

View file

@ -0,0 +1,40 @@
---
name: checks
on: # yamllint disable-line rule:truthy
- 'push'
jobs:
pre-commit:
runs-on: ubuntu-22.04
steps:
- uses: https://code.forgejo.org/actions/checkout@v4
- uses: https://code.forgejo.org/actions/setup-python@v5
with:
python-version: '3.10'
- uses: opentofu/setup-opentofu@v1
with:
tofu_version: 1.7.0
- uses: pre-commit/action@v3.0.1
k8s:
runs-on: ubuntu-22.04
steps:
- uses: https://code.forgejo.org/actions/checkout@v4
- name: Set up Kubeconform
uses: bmuschko/setup-kubeconform@v1
- name: Validate manifests
run: make lint--kubeconform
tflint:
runs-on: ubuntu-22.04
steps:
- uses: https://code.forgejo.org/actions/checkout@v4
- uses: terraform-linters/setup-tflint@v4
name: Setup TFLint
with:
tflint_version: v0.50.3
- name: Run TFLint
run: make lint--tflint

View file

@ -1,7 +1,7 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
@ -18,7 +18,7 @@ repos:
- id: trailing-whitespace
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.86.0
rev: v1.92.1
hooks:
- id: terraform_fmt

View file

@ -4,8 +4,9 @@ lint--pre-commit:
lint--kubeconform:
kubeconform -strict -ignore-missing-schemas k8s/
SHELl=/bin/bash
lint--kubescore:
kube-score score k8s/**.yaml
kube-score score $$(find k8s -type f -print -name "*.yaml")
lint--tflint:
tflint --recursive
@ -14,4 +15,5 @@ lint--tflint:
lint:
make lint--pre-commit
make lint--kubeconform
make lint--kube
make lint--tflint

View file

@ -24,8 +24,6 @@ services:
command: '/bin/sh -c "sleep 5; forgejo-runner daemon"'
environment:
DOCKER_HOST: tcp://docker-in-docker:2375
networks:
- forgejo
volumes:
- ${FORGEJO_RUNNER_DATA:-/mnt/nas1/shared/forgejo-runner/data}:/data
- /etc/timezone:/etc/timezone:ro

View file

@ -1,12 +1,3 @@
variable "argo_workflows_client_id" {
description = "Client ID"
type = string
}
variable "argo_workflows_client_secret" {
description = "Client secret"
type = string
}
variable "firezone_client_id" {
description = "Client ID"