forked from catalin/fukuops
ci: add pre-commit, k8s and tflint action workflows
This commit is contained in:
parent
ce8747472c
commit
399dd397bb
5 changed files with 45 additions and 14 deletions
40
.forgejo/workflows/ci.yaml
Normal file
40
.forgejo/workflows/ci.yaml
Normal 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
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v3.2.0
|
rev: v4.6.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
|
|
@ -18,7 +18,7 @@ repos:
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
|
|
||||||
- repo: https://github.com/antonbabenko/pre-commit-terraform
|
- repo: https://github.com/antonbabenko/pre-commit-terraform
|
||||||
rev: v1.86.0
|
rev: v1.92.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: terraform_fmt
|
- id: terraform_fmt
|
||||||
|
|
||||||
|
|
|
||||||
4
Makefile
4
Makefile
|
|
@ -4,8 +4,9 @@ lint--pre-commit:
|
||||||
lint--kubeconform:
|
lint--kubeconform:
|
||||||
kubeconform -strict -ignore-missing-schemas k8s/
|
kubeconform -strict -ignore-missing-schemas k8s/
|
||||||
|
|
||||||
|
SHELl=/bin/bash
|
||||||
lint--kubescore:
|
lint--kubescore:
|
||||||
kube-score score k8s/**.yaml
|
kube-score score $$(find k8s -type f -print -name "*.yaml")
|
||||||
|
|
||||||
lint--tflint:
|
lint--tflint:
|
||||||
tflint --recursive
|
tflint --recursive
|
||||||
|
|
@ -14,4 +15,5 @@ lint--tflint:
|
||||||
lint:
|
lint:
|
||||||
make lint--pre-commit
|
make lint--pre-commit
|
||||||
make lint--kubeconform
|
make lint--kubeconform
|
||||||
|
make lint--kube
|
||||||
make lint--tflint
|
make lint--tflint
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,6 @@ services:
|
||||||
command: '/bin/sh -c "sleep 5; forgejo-runner daemon"'
|
command: '/bin/sh -c "sleep 5; forgejo-runner daemon"'
|
||||||
environment:
|
environment:
|
||||||
DOCKER_HOST: tcp://docker-in-docker:2375
|
DOCKER_HOST: tcp://docker-in-docker:2375
|
||||||
networks:
|
|
||||||
- forgejo
|
|
||||||
volumes:
|
volumes:
|
||||||
- ${FORGEJO_RUNNER_DATA:-/mnt/nas1/shared/forgejo-runner/data}:/data
|
- ${FORGEJO_RUNNER_DATA:-/mnt/nas1/shared/forgejo-runner/data}:/data
|
||||||
- /etc/timezone:/etc/timezone:ro
|
- /etc/timezone:/etc/timezone:ro
|
||||||
|
|
|
||||||
|
|
@ -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" {
|
variable "firezone_client_id" {
|
||||||
description = "Client ID"
|
description = "Client ID"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue