Skip to content

Commit 8eb9b3a

Browse files
authored
ci: use global org workflows (#282)
* ci: use global workflows Signed-off-by: Tyler Gillson <[email protected]> * chore: trigger CI Signed-off-by: Tyler Gillson <[email protected]> * ci: add back workflow_dispatch directives Signed-off-by: Tyler Gillson <[email protected]> * ci: fix typos Signed-off-by: Tyler Gillson <[email protected]> * ci: fix test Make target Signed-off-by: Tyler Gillson <[email protected]> --------- Signed-off-by: Tyler Gillson <[email protected]>
1 parent 849a047 commit 8eb9b3a

11 files changed

+47
-323
lines changed

.github/workflows/bulwark-gitleaks.yaml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/workflows/bulwark-golicences.yaml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/bulwark-gosec.yaml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/bulwark-govulncheck.yaml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/gitleaks.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: GitLeaks
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
jobs:
8+
call-gitleaks:
9+
uses: validator-labs/workflows/.github/workflows/gitleaks.yaml@main
10+
secrets: inherit

.github/workflows/golicences.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: GoLicenses
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
jobs:
8+
call-golicenses:
9+
uses: validator-labs/workflows/.github/workflows/golicenses.yaml@main
10+
secrets: inherit

.github/workflows/gosec.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: GoSec
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
jobs:
8+
call-gosec:
9+
uses: validator-labs/workflows/.github/workflows/gosec.yaml@main
10+
secrets: inherit

.github/workflows/govulncheck.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: GoVulnCheck
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
jobs:
8+
call-govulncheck:
9+
uses: validator-labs/workflows/.github/workflows/govulncheck.yaml@main
10+
secrets: inherit

.github/workflows/release.yaml

Lines changed: 3 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -5,105 +5,8 @@ on:
55
branches:
66
- main
77
- '[0-9]+.[0-9]+.x'
8-
workflow_dispatch:
9-
10-
env:
11-
REGISTRY: quay.io
12-
GITHUB_PAGES_BRANCH: gh_pages
13-
14-
defaults:
15-
run:
16-
shell: bash
178

189
jobs:
19-
release-please:
20-
permissions:
21-
contents: write # for google-github-actions/release-please-action to create release commit
22-
pull-requests: write # for google-github-actions/release-please-action to create release PR
23-
runs-on: [self-hosted, Linux, X64, validator]
24-
outputs:
25-
releases_created: ${{ steps.release.outputs.releases_created }}
26-
tag_name: ${{ steps.release.outputs.tag_name }}
27-
# Release-please creates a PR that tracks all changes
28-
steps:
29-
- name: Checkout
30-
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
31-
32-
- uses: google-github-actions/release-please-action@e4dc86ba9405554aeba3c6bb2d169500e7d3b4ee # v4
33-
id: release
34-
with:
35-
token: ${{ secrets.PAT }}
36-
37-
release-charts:
38-
needs: release-please
39-
permissions:
40-
contents: write
41-
runs-on: [self-hosted, Linux, X64, validator]
42-
if: needs.release-please.outputs.releases_created == 'true'
43-
steps:
44-
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
45-
- name: Publish Helm chart
46-
uses: stefanprodan/helm-gh-pages@master
47-
with:
48-
token: ${{ secrets.PAT }}
49-
charts_dir: chart
50-
owner: validator-labs
51-
branch: ${{ env.GITHUB_PAGES_BRANCH }}
52-
commit_username: validator-labs-bot
53-
commit_email: [email protected]
54-
55-
build-container:
56-
if: needs.release-please.outputs.releases_created == 'true'
57-
needs:
58-
- release-please
59-
runs-on: [self-hosted, Linux, X64, validator]
60-
permissions:
61-
contents: write
62-
packages: write
63-
id-token: write
64-
env:
65-
IMAGE_TAG: quay.io/validator-labs/validator:${{ needs.release-please.outputs.tag_name }}
66-
IMAGE_NAME: validator
67-
steps:
68-
- name: Checkout
69-
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
70-
with:
71-
submodules: recursive
72-
73-
- name: Set up Docker Buildx
74-
id: buildx
75-
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3
76-
77-
- name: Login to GitHub Container Registry
78-
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3
79-
with:
80-
registry: "quay.io"
81-
username: ${{ secrets.QUAY_USER }}
82-
password: ${{ secrets.QUAY_TOKEN }}
83-
84-
- name: Build Docker Image
85-
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5
86-
with:
87-
context: .
88-
file: ./Dockerfile
89-
platforms: linux/amd64,linux/arm64
90-
target: production
91-
tags: |
92-
${{ env.IMAGE_TAG }}
93-
builder: ${{ steps.buildx.outputs.name }}
94-
push: true
95-
cache-from: type=gha,scope=${{ github.ref_name }}-${{ env.IMAGE_TAG }}
96-
cache-to: type=gha,scope=${{ github.ref_name }}-${{ env.IMAGE_TAG }}
97-
98-
- name: Generate SBOM
99-
uses: anchore/sbom-action@e8d2a6937ecead383dfe75190d104edd1f9c5751 # v0.16.0
100-
with:
101-
image: ${{ env.IMAGE_TAG }}
102-
artifact-name: sbom-${{ env.IMAGE_NAME }}
103-
output-file: ./sbom-${{ env.IMAGE_NAME }}.spdx.json
104-
105-
- name: Attach SBOM to release
106-
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87 # v2
107-
with:
108-
tag_name: ${{ needs.release-please.outputs.tag_name }}
109-
files: ./sbom-${{ env.IMAGE_NAME }}.spdx.json
10+
call-release:
11+
uses: validator-labs/workflows/.github/workflows/release.yaml@main
12+
secrets: inherit

.github/workflows/test.yaml

Lines changed: 3 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -7,82 +7,7 @@ on:
77
pull_request:
88
workflow_dispatch:
99

10-
concurrency:
11-
group: test-${{ github.ref }}
12-
cancel-in-progress: true
13-
1410
jobs:
15-
test:
16-
name: Run Unit & Integration Tests
17-
runs-on: [self-hosted, Linux, X64, validator]
18-
steps:
19-
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
20-
21-
- name: Set up Go
22-
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5
23-
with:
24-
cache: false
25-
go-version-file: go.mod
26-
27-
- name: Set up Helm
28-
run: make helm
29-
30-
- name: Test
31-
run: make test
32-
33-
- name: Workaround for https://github.com/codecov/feedback/issues/263
34-
run: |
35-
git config --global --add safe.directory "$GITHUB_WORKSPACE"
36-
37-
- name: Codecov
38-
uses: codecov/codecov-action@125fc84a9a348dbcf27191600683ec096ec9021c # v4
39-
with:
40-
file: ./cover.out
41-
fail_ci_if_error: true
42-
token: ${{ secrets.CODECOV_TOKEN }}
43-
44-
test-chart:
45-
name: Run Helm Chart Tests
46-
runs-on: [self-hosted, Linux, X64, validator]
47-
if: "!(contains(github.head_ref, 'release-please') || contains(github.ref, 'release-please'))"
48-
steps:
49-
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
50-
with:
51-
fetch-depth: 0
52-
53-
- name: Set up Helm
54-
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4
55-
with:
56-
version: v3.11.2
57-
58-
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5
59-
with:
60-
python-version: '3.9'
61-
check-latest: true
62-
63-
- name: Set up chart-testing
64-
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1
65-
66-
- name: Run chart-testing (list-changed)
67-
id: list-changed
68-
run: |
69-
set -ex
70-
changed=$(ct list-changed --chart-dirs chart --target-branch ${{ github.event.repository.default_branch }})
71-
echo $changed
72-
if [[ -n "$changed" ]]; then
73-
echo "changed=true" >> "$GITHUB_OUTPUT"
74-
fi
75-
76-
- name: Run chart-testing (lint)
77-
if: steps.list-changed.outputs.changed == 'true'
78-
run: |
79-
cd $GITHUB_WORKSPACE
80-
ct lint --validate-maintainers=false --check-version-increment=false --chart-dirs chart --target-branch ${{ github.event.repository.default_branch }}
81-
82-
- name: Create kind cluster
83-
if: steps.list-changed.outputs.changed == 'true'
84-
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
85-
86-
- name: Run chart-testing (install)
87-
if: steps.list-changed.outputs.changed == 'true'
88-
run: ct install --chart-dirs chart --target-branch ${{ github.event.repository.default_branch }}
11+
call-test:
12+
uses: validator-labs/workflows/.github/workflows/test.yaml@main
13+
secrets: inherit

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ vet: ## Run go vet against code.
6666
go vet ./...
6767

6868
.PHONY: test
69-
test: manifests generate fmt vet envtest ## Run tests.
69+
test: manifests generate fmt vet envtest helm ## Run tests.
7070
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
7171

7272
##@ Build

0 commit comments

Comments
 (0)