Skip to content

Commit

Permalink
Merge branch 'main' into add-chainsaw-test
Browse files Browse the repository at this point in the history
  • Loading branch information
vishal-chdhry authored Feb 5, 2024
2 parents 24070cf + 8c363b1 commit 9f4c0d8
Show file tree
Hide file tree
Showing 12 changed files with 109 additions and 100 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ah-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

name: ArtifactHub Lint

# permissions: {}
permissions: {}

on:
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

name: Check actions

# permissions: {}
permissions: {}

on:
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codegen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

name: Verify codegen

# permissions: {}
permissions: {}

on:
pull_request:
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/codeql._yaml

This file was deleted.

44 changes: 44 additions & 0 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: CodeQL

permissions: {}

on:
pull_request:
branches:
- main
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
required:
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@d43c1f16c00cfd3978dde6c07f4bbcf9eb6993ca # v0.16.1
with:
scan-type: fs
ignore-unfixed: false
format: sarif
output: trivy-results.sarif
severity: CRITICAL,HIGH,MEDIUM
scanners: vuln,secret
exit-code: '0'
vuln-type: os,library
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@cdcdbb579706841c47f7063dda365e292e5cad7a # v2.13.4
with:
sarif_file: trivy-results.sarif
category: code
2 changes: 1 addition & 1 deletion .github/workflows/ct-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

name: CT Lint

# permissions: {}
permissions: {}

on:
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/helm-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

name: Helm install

# permissions: {}
permissions: {}

on:
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

name: Lint

# permissions: {}
permissions: {}

on:
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

name: Release

# permissions: {}
permissions: {}

on:
push:
Expand Down
49 changes: 0 additions & 49 deletions .github/workflows/tests._yaml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: Tests

permissions: {}

on:
pull_request:
branches:
- main
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: go.mod
cache-dependency-path: go.sum
# - name: Create test cluster
# run: |
# set -e
# make kind-cluster
- name: Run tests
run: |
set -e
make tests
- name: Upload Report to Codecov
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
with:
file: ./coverage.out
fail_ci_if_error: true
verbose: true

required:
needs:
- unit-tests
runs-on: ubuntu-latest
steps:
- run: echo "Required jobs success!"
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@ ko-build: $(KO) ## Build image (with ko)
@LDFLAGS=$(LD_FLAGS) KOCACHE=$(KO_CACHE) KO_DOCKER_REPO=$(KO_REGISTRY) \
$(KO) build . --preserve-import-paths --tags=$(KO_TAGS) --platform=$(LOCAL_PLATFORM)

########
# TEST #
########

.PHONY: tests
tests: build ## Run tests
@echo Running tests... >&2
@go test ./... -race -coverprofile=coverage.out -covermode=atomic

###########
# CODEGEN #
###########
Expand Down

0 comments on commit 9f4c0d8

Please sign in to comment.