Skip to content

Merge pull request #277 from vmercierfr/pin-workflow-version #472

Merge pull request #277 from vmercierfr/pin-workflow-version

Merge pull request #277 from vmercierfr/pin-workflow-version #472

Workflow file for this run

---
name: unittest
on: # yamllint disable-line rule:truthy
push:
branches:
- "*"
permissions:
contents: read
jobs:
go:
name: go
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
with:
go-version: "1.22"
- name: Install dependencies
run: |
go get .
- name: Build
run: make build
- name: Run Go tests
run: make test
- name: Code Coverage Report
uses: irongut/CodeCoverageSummary@51cc3a756ddcd398d447c044c02cb6aa83fdae95 # v1.3.0
with:
filename: coverage.xml
badge: true
fail_below_min: true
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: "60 80"
- uses: jwalton/gh-find-current-pr@f3d61b485d2801773f7a07b2aaa3306bd8f8e653 # v1.3.5
id: finder
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
with:
number: ${{ github.event.pull_request.number }}
path: code-coverage-results.md
recreate: true
helm:
name: helm
runs-on: ubuntu-latest
env:
HELM_UNITTEST_VERSION: v0.3.5
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Install helm-unittest
run: helm plugin install --version $HELM_UNITTEST_VERSION https://github.com/helm-unittest/helm-unittest.git
- name: Run Helm test
run: make helm-test
kubeconform:
name: kubeconform
runs-on: ubuntu-latest
env:
KUBECONFORM_VERSION: 0.6.2
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Install kubeconform
run: |
curl -sSLo /tmp/kubeconform.tar.gz "https://github.com/yannh/kubeconform/releases/download/v${KUBECONFORM_VERSION}/kubeconform-linux-amd64.tar.gz" \
&& echo "d2a10db6b78d56de8fe9375b9c351bc573aa218a74da04d114767b505a675090 /tmp/kubeconform.tar.gz" | sha256sum --check \
&& tar -C /usr/local/bin/ -xzvf /tmp/kubeconform.tar.gz
- name: Run Kubeconform test
run: make kubeconform
debian:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
fetch-depth: 0
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
with:
go-version: '1.24'
- name: Set up QEMU for ARM64 build
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
- uses: goreleaser/goreleaser-action@5742e2a039330cbb23ebf35f046f814d4c6ff811 # v5.1.0
with:
distribution: goreleaser
version: latest
args: release --clean --skip=publish --skip=docker --snapshot
env:
GORELEASER_CURRENT_TAG: 0.0.0
- name: Run Debian package tests
run: make debian-test-ci
checkcov:
permissions:
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Checkov GitHub Action
uses: bridgecrewio/checkov-action@4048c972aae68d0b983a48bb3479aab2d877b898 # v12
with:
# This will add both a CLI output to the console and create a results.sarif file
output_format: cli,sarif
output_file_path: console,results.sarif
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@7fd177fa680c9881b53cdab4d346d32574c9f7f4 # v3.35.4
# Results are generated only on a success or failure
# this is required since GitHub by default won't run the next step
# when the previous one has failed. Security checks that do not pass will 'fail'.
# An alternative is to add `continue-on-error: true` to the previous step
# Or 'soft_fail: true' to checkov.
if: success() || failure()
with:
sarif_file: results.sarif