Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: "Code Checks"

on:
workflow_call:

permissions:
contents: read
id-token: write
security-events: write

jobs:
code-checks:
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v6

- name: "Install dependencies"
uses: ./.github/actions/dependencies

- name: "🐹 Go"
working-directory: apps
run: |
set -e

for d in $(ls -1); do
cd $d
echo "$d:"
echo -e " fmt:\033[0;31m"
test -z "$(go fmt ./... | tee /dev/stderr)"
echo -e "\033[0;32m pass\033[0m"
echo -e " vet:\033[0;31m"
go vet ./...
echo -e "\033[0;32m pass\033[0m"
cd ..
done

- name: "☁️ Terraform"
working-directory: infra
run: |
echo "Terraform init"
terraform init -backend=false

echo "Terraform validate"
terraform validate

- name: "🚥 Checkov"
uses: bridgecrewio/checkov-action@v12
with:
config_file: .checkov.yaml
output_format: cli,sarif
output_file_path: console,results.sarif

- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v4
if: success() || failure()
with:
sarif_file: results.sarif
1 change: 1 addition & 0 deletions .github/workflows/infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: read
Expand Down
51 changes: 5 additions & 46 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
pull_request:
branches:
- main
push:
branches:
- main

permissions:
contents: read
Expand All @@ -12,54 +15,10 @@ permissions:

jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v6

- name: "Install dependencies"
uses: ./.github/actions/dependencies

- name: "🐹 Go"
working-directory: apps
run: |
set -e

for d in $(ls -1); do
cd $d
echo "$d:"
echo -e " fmt:\033[0;31m"
test -z "$(go fmt ./... | tee /dev/stderr)"
echo -e "\033[0;32m pass\033[0m"
echo -e " vet:\033[0;31m"
go vet ./...
echo -e "\033[0;32m pass\033[0m"
cd ..
done

- name: "☁️ Terraform"
working-directory: infra
run: |
echo "Terraform init"
terraform init -backend=false

echo "Terraform validate"
terraform validate

- name: "🚥 Checkov"
uses: bridgecrewio/checkov-action@v12
with:
config_file: .checkov.yaml
output_format: cli,sarif
output_file_path: console,results.sarif

- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v4
if: success() || failure()
with:
sarif_file: results.sarif
uses: ./.github/workflows/_check.yml

terraform-plan:
if: github.event_name == 'pull_request'
concurrency: "sandbox"
needs: [validate]
uses: ./.github/workflows/_tf_plan.yml
Expand Down
Loading