-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d88e390
commit 725a541
Showing
18 changed files
with
474 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
## Reference: https://github.com/helm/chart-testing/blob/master/doc/ct_lint-and-install.md | ||
## | ||
remote: origin | ||
target-branch: main | ||
chart-dirs: | ||
- helm/ | ||
chart-repos: | ||
- buttahtoast=https://buttahtoast.github.io/helm-charts/ | ||
- bitnami=https://charts.bitnami.com/bitnami | ||
validate-chart-schema: true | ||
validate-maintainers: false | ||
validate-yaml: true | ||
exclude-deprecated: true | ||
check-version-increment: false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
rules: | ||
braces: | ||
min-spaces-inside: 0 | ||
max-spaces-inside: 0 | ||
min-spaces-inside-empty: -1 | ||
max-spaces-inside-empty: -1 | ||
brackets: | ||
min-spaces-inside: 0 | ||
max-spaces-inside: 0 | ||
min-spaces-inside-empty: -1 | ||
max-spaces-inside-empty: -1 | ||
colons: | ||
max-spaces-before: 0 | ||
max-spaces-after: 1 | ||
commas: | ||
max-spaces-before: 0 | ||
min-spaces-after: 1 | ||
max-spaces-after: 1 | ||
comments: | ||
require-starting-space: true | ||
min-spaces-from-content: 1 | ||
document-end: disable | ||
document-start: disable # No --- to start a file | ||
empty-lines: | ||
max: 2 | ||
max-start: 0 | ||
max-end: 0 | ||
hyphens: | ||
max-spaces-after: 1 | ||
indentation: | ||
spaces: consistent | ||
indent-sequences: whatever # - list indentation will handle both indentation and without | ||
check-multi-line-strings: false | ||
key-duplicates: enable | ||
line-length: disable # Lines can be any length | ||
new-line-at-end-of-file: enable | ||
new-lines: | ||
type: unix | ||
trailing-spaces: enable | ||
truthy: | ||
level: warning |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "gomod" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
open-pull-requests-limit: 10 | ||
- package-ecosystem: "docker" | ||
directory: "/" | ||
schedule: | ||
interval: weekly |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Check actions | ||
permissions: {} | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
pull_request: | ||
branches: [ "master", "main" ] | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | ||
- name: Ensure SHA pinned actions | ||
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@f32435541e24cd6a4700a7f52bb2ec59e80603b1 # v2.1.4 | ||
with: | ||
# slsa-github-generator requires using a semver tag for reusable workflows. | ||
# See: https://github.com/slsa-framework/slsa-github-generator#referencing-slsa-builders-and-generators | ||
allowlist: | | ||
slsa-framework/slsa-github-generator |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Check Commit | ||
permissions: {} | ||
|
||
on: | ||
push: | ||
branches: [ "*" ] | ||
pull_request: | ||
branches: [ "*" ] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
commit_lint: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | ||
with: | ||
fetch-depth: 0 | ||
- uses: wagoid/commitlint-github-action@6319f54d83768b60acd6fd60e61007ccc583e62f #v5.4.3 | ||
with: | ||
firstParent: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Integration Test | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "master" | ||
push: | ||
branches: | ||
- "master" | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
integration-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Check secret | ||
id: checksecret | ||
uses: oliverbaehler/github-actions/exists@8dfd42735c85f6c58d5d4d6f3232cd0e39d1fe73 # v0.1.0 | ||
with: | ||
value: ${{ secrets.CODECOV_TOKEN }} | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.19' | ||
- name: Run integration tests | ||
run: | | ||
make integration-test | ||
- name: Upload coverage reports to Codecov | ||
if: steps.checksecret.outputs.result == 'true' | ||
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 | ||
with: | ||
files: ./test/integration/cover.out | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Build images | ||
permissions: {} | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
pull_request: | ||
branches: [ "master", "main" ] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-images: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | ||
- name: ko build | ||
run: VERSION=${{ github.ref_name }} REPOSITORY=${GITHUB_REPOSITORY} make ko-build-all | ||
- name: Trivy Scan Image | ||
uses: aquasecurity/trivy-action@fbd16365eb88e12433951383f5e99bd901fc618f # v0.12.0 | ||
with: | ||
scan-type: 'fs' | ||
ignore-unfixed: true | ||
format: 'sarif' | ||
output: 'trivy-results.sarif' | ||
severity: 'CRITICAL,HIGH' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Publish images | ||
permissions: {} | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
jobs: | ||
publish-images: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
id-token: write | ||
outputs: | ||
container-digest: ${{ steps.publish.outputs.digest }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | ||
- name: "Extract Version" | ||
id: extract_version | ||
run: | | ||
GIT_TAG=${GITHUB_REF##*/} | ||
VERSION=${GIT_TAG##v} | ||
echo "version=$(echo $VERSION)" >> $GITHUB_OUTPUT | ||
- name: Run Trivy vulnerability (Repo) | ||
uses: aquasecurity/trivy-action@fbd16365eb88e12433951383f5e99bd901fc618f # v0.12.0 | ||
with: | ||
scan-type: 'fs' | ||
ignore-unfixed: true | ||
format: 'sarif' | ||
output: 'trivy-results.sarif' | ||
severity: 'CRITICAL,HIGH' | ||
- name: Install Cosign | ||
uses: sigstore/cosign-installer@11086d25041f77fe8fe7b9ea4e48e3b9192b8f19 # v3.1.2 | ||
- name: Publish with KO | ||
id: publish | ||
uses: oliverbaehler/github-actions/ko-publish-image@8dfd42735c85f6c58d5d4d6f3232cd0e39d1fe73 # v0.1.0 | ||
with: | ||
makefile-target: ko-publish-all | ||
registry: ghcr.io | ||
registry-username: ${{ github.actor }} | ||
registry-password: ${{ secrets.GITHUB_TOKEN }} | ||
repository: ${{ github.repository_owner }} | ||
version: ${{ steps.extract_version.outputs.version }} | ||
sign-image: true | ||
sbom-name: svc-ingress-propagator | ||
sbom-repository: ghcr.io/${{ github.repository_owner }}/sbom | ||
signature-repository: ghcr.io/${{ github.repository_owner }}/signatures | ||
main-path: ./cmd/ | ||
env: | ||
REPOSITORY: ${{ github.repository }} | ||
VERSION: ${{ steps.extract_version.outputs.version }} | ||
generate-provenance: | ||
needs: publish-images | ||
permissions: | ||
id-token: write # To sign the provenance. | ||
packages: write # To upload assets to release. | ||
actions: read # To read the workflow path. | ||
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] | ||
with: | ||
image: ghcr.io/${{ github.repository_owner }}/svc-ingress-propagator | ||
digest: "${{ needs.publish-images.outputs.container-digest }}" | ||
registry-username: ${{ github.actor }} | ||
secrets: | ||
registry-password: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Publish charts | ||
permissions: read-all | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
jobs: | ||
publish-helm: | ||
runs-on: ubuntu-20.04 | ||
permissions: | ||
contents: write | ||
id-token: write | ||
packages: write | ||
outputs: | ||
chart-digest: ${{ steps.helm_publish.outputs.digest }} | ||
steps: | ||
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | ||
- uses: sigstore/cosign-installer@11086d25041f77fe8fe7b9ea4e48e3b9192b8f19 # v3.1.2 | ||
- name: "Extract Version" | ||
id: extract_version | ||
run: | | ||
GIT_TAG=${GITHUB_REF##*/} | ||
VERSION=${GIT_TAG##v} | ||
echo "version=$(echo $VERSION)" >> $GITHUB_OUTPUT | ||
- name: Helm | Publish | ||
id: helm_publish | ||
uses: oliverbaehler/github-actions/helm-oci-chart@dev | ||
with: | ||
registry: ghcr.io | ||
repository: ${{ github.repository_owner }}/charts | ||
name: "svc-ingress-propagator" | ||
path: "./helm" | ||
app-version: ${{ steps.extract_version.outputs.version }} | ||
version: ${{ steps.extract_version.outputs.version }} | ||
registry-username: ${{ github.actor }} | ||
registry-password: ${{ secrets.GITHUB_TOKEN }} | ||
update-dependencies: 'true' # Defaults to false | ||
sign-image: 'true' | ||
signature-repository: ghcr.io/${{ github.repository_owner }}/signatures | ||
helm-provenance: | ||
needs: publish-helm | ||
permissions: | ||
id-token: write # To sign the provenance. | ||
packages: write # To upload assets to release. | ||
actions: read # To read the workflow path. | ||
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] | ||
with: | ||
image: ghcr.io/${{ github.repository_owner }}/charts/svc-ingress-propagator | ||
digest: "${{ needs.publish-helm.outputs.chart-digest }}" | ||
registry-username: ${{ github.actor }} | ||
secrets: | ||
registry-password: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Test charts | ||
permissions: {} | ||
|
||
on: | ||
push: | ||
branches: [ "*" ] | ||
pull_request: | ||
branches: [ "master", "main" ] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | ||
with: | ||
fetch-depth: 0 | ||
- uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3 | ||
- name: Setup Chart Linting | ||
id: lint | ||
uses: helm/chart-testing-action@e8788873172cb653a90ca2e819d79d65a66d4e76 # v2.4.0 | ||
- name: Run chart-testing (list-changed) | ||
id: list-changed | ||
run: | | ||
changed=$(ct list-changed --config .github/configs/ct.yaml) | ||
if [[ -n "$changed" ]]; then | ||
echo "::set-output name=changed::true" | ||
fi | ||
- name: Run chart-testing (lint) | ||
run: ct lint --debug --config .github/configs/ct.yaml --lint-conf .github/configs/lintconf.yaml | ||
- name: Run docs-testing (helm-docs) | ||
id: helm-docs | ||
run: | | ||
make helm-docs | ||
if [[ $(git diff --stat) != '' ]]; then | ||
echo -e '\033[0;31mDocumentation outdated! (Run make helm-docs locally and commit)\033[0m ❌' | ||
git diff --color | ||
exit 1 | ||
else | ||
echo -e '\033[0;32mDocumentation up to date\033[0m ✔' | ||
fi | ||
## Create KIND Cluster | ||
- name: Create kind cluster | ||
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0 | ||
if: steps.list-changed.outputs.changed == 'true' | ||
|
||
# Install Charts | ||
- name: Run chart-testing (install) | ||
run: ct install --debug --config .github/configs/ct.yaml | ||
if: steps.list-changed.outputs.changed == 'true' |
Oops, something went wrong.