Update github/codeql-action action to v3.27.9 #942
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test PRs | |
on: | |
pull_request: | |
types: | |
- labeled | |
- opened | |
- edited | |
- reopened | |
- synchronize | |
- ready_for_review | |
# Explicitly grant the `secrets.GITHUB_TOKEN` no permissions. | |
permissions: {} | |
jobs: | |
AMD-test-via-docker: | |
name: AMD64 - Build and test via Docker 🐳 images 📦 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Action | |
uses: actions/[email protected] | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Build alpine based image | |
uses: docker/[email protected] | |
with: | |
file: Dockerfile-alpine | |
context: . | |
push: false # DO NOT PUSH AS UNTRUSTED | |
tags: | | |
ghcr.io/richardoc/kube-audit-rest:test-alpine | |
platforms: linux/amd64 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Build distroless image | |
uses: docker/[email protected] | |
with: | |
file: Dockerfile-distroless | |
context: . | |
push: false # DO NOT PUSH AS UNTRUSTED | |
tags: | | |
ghcr.io/richardoc/kube-audit-rest:test-distroless | |
ghcr.io/richardoc/kube-audit-rest:latest | |
platforms: linux/amd64 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
ARM-test-via-docker: | |
name: ARM64 - Build and test via Docker 🐳 images 📦 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Action | |
uses: actions/[email protected] | |
- name: Set up QEMU | |
uses: docker/[email protected] | |
with: | |
platforms: 'arm64' | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Build alpine based image | |
uses: docker/[email protected] | |
with: | |
file: Dockerfile-alpine | |
context: . | |
push: false # DO NOT PUSH AS UNTRUSTED | |
tags: | | |
ghcr.io/richardoc/kube-audit-rest:test-alpine | |
platforms: linux/arm64 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Build distroless image | |
uses: docker/[email protected] | |
with: | |
file: Dockerfile-distroless | |
context: . | |
push: false # DO NOT PUSH AS UNTRUSTED | |
tags: | | |
ghcr.io/richardoc/kube-audit-rest:test-distroless | |
ghcr.io/richardoc/kube-audit-rest:latest | |
platforms: linux/amd64,linux/arm64 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
execute-unittests: | |
name: Execute the unittests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Action | |
uses: actions/[email protected] | |
- name: Set up Go | |
uses: actions/[email protected] | |
with: | |
go-version: 1.22 | |
- name: Build | |
run: go build -v ./... | |
- name: Test | |
run: go test -v ./... | |
run-trivy: | |
name: Run trivy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Action | |
uses: actions/[email protected] | |
- name: Run Trivy vulnerability scanner in fs mode | |
uses: aquasecurity/trivy-action@master | |
with: | |
scan-type: 'fs' | |
scan-ref: '.' | |
format: 'sarif' | |
output: 'repo-results.sarif' | |
exit-code: '1' | |
severity: 'CRITICAL,HIGH' | |
run-semgrep: | |
name: Run Semgrep | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Action | |
uses: actions/[email protected] | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Run semgrep | |
# excluding yamls due to false positives with the elasticsearch example for now | |
run: docker run --rm -v "${PWD}:/src" returntocorp/semgrep:1.48.0-nonroot@sha256:572b06425becea5b9b26bcd01f78553383ab052debfeb2c57720cebd6999d964 semgrep ci --config auto --exclude=*.yaml |