Skip to content

Commit 4e1b2a6

Browse files
authored
chore: massive redo of Operator (#295)
* chore: massive redo of Operator * fix bugs with webhooks * fix build ci workflow * fix invalid echo in test workflow * delete redundant webhooks test in api package
1 parent bda0e29 commit 4e1b2a6

File tree

75 files changed

+6161
-565
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+6161
-565
lines changed
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: "Setup Go"
2+
description: "Setup Go with caching"
3+
inputs:
4+
cache-prefix:
5+
description: "Prefix for the cache key"
6+
required: false
7+
default: "go"
8+
disable-cache:
9+
description: "Disable caching"
10+
required: false
11+
default: "false"
12+
go-version:
13+
description: "Version of Go. Default 1.21"
14+
required: false
15+
default: "1.21"
16+
outputs:
17+
go-version:
18+
description: "The installed Go version"
19+
value: ${{ steps.setup-go.outputs.go-version }}
20+
runs:
21+
using: "composite"
22+
steps:
23+
- id: setup-go
24+
uses: actions/setup-go@v4
25+
with:
26+
go-version: ${{ inputs.go-version }}
27+
check-latest: true
28+
cache: false
29+
- id: cache-info
30+
if: ${{ inputs.disable-cache != 'true' }}
31+
shell: bash
32+
run: echo path=$(go env GOCACHE) >> $GITHUB_OUTPUT
33+
- uses: actions/cache@v3
34+
if: ${{ inputs.disable-cache != 'true' }}
35+
with:
36+
path: ${{ steps.cache-info.outputs.path }}
37+
key: ${{ inputs.cache-prefix }}-go-${{ steps.setup-go.outputs.go-version }}-mod-${{ hashFiles('go.sum') }}

.github/workflows/build.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Build
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
14+
- name: Setup Go
15+
id: setup-go
16+
uses: ./.github/actions/setup-go-cache
17+
with:
18+
cache-prefix: go-build
19+
20+
- name: Set up Docker Buildx
21+
id: buildx
22+
uses: docker/setup-buildx-action@v2
23+
24+
- uses: goreleaser/goreleaser-action@v5
25+
with:
26+
distribution: goreleaser
27+
version: v1.22.1
28+
args: build --snapshot --clean
29+
env:
30+
DOCKER_REPO: "gresearch"
31+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
32+
DOCKER_BUILDX_BUILDER: "${{ steps.buildx.outputs.name }}"

.github/workflows/ci.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
uses: ./.github/workflows/test.yml
2626
codeql:
2727
uses: ./.github/workflows/codeql.yml
28+
build:
29+
uses: ./.github/workflows/build.yml
2830
# Virtual job that can be configured as a required check before a PR can be merged.
2931
all-required-checks-done:
3032
name: All required checks done
@@ -33,7 +35,8 @@ jobs:
3335
- lint
3436
- test
3537
- codeql
36-
runs-on: ubuntu-22.04
38+
- build
39+
runs-on: ubuntu-latest
3740
steps:
3841
- uses: actions/github-script@v6
3942
with:

.github/workflows/codeql.yml

+2-7
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,14 @@ jobs:
3131
fail-fast: false
3232
matrix:
3333
language: ['go']
34-
go: [ '1.20' ]
34+
go: [ '1.21' ]
3535
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
3636
# Learn more:
3737
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
3838

3939
steps:
4040
- name: Checkout
41-
uses: actions/checkout@v3
42-
43-
- name: Setup Golang with cache
44-
uses: magnetikonline/action-golang-cache@v4
45-
with:
46-
go-version: "1.20"
41+
uses: actions/checkout@v4
4742

4843
# Initializes the CodeQL tools for scanning.
4944
- name: Initialize CodeQL

.github/workflows/lint.yml

+7-8
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,19 @@ permissions:
1010
jobs:
1111
go-lint:
1212
name: Golang Lint
13-
runs-on: ubuntu-22.04
13+
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717

18-
- name: Setup Golang with cache
19-
uses: magnetikonline/action-golang-cache@v4
18+
- uses: actions/setup-go@v4
2019
with:
21-
go-version: "1.20"
20+
go-version: '1.21'
21+
cache: false
2222

2323
- name: golangci-lint
2424
uses: golangci/golangci-lint-action@v3
2525
with:
2626
version: "latest"
27-
skip-pkg-cache: true
28-
skip-build-cache: true
29-
args: "-c ./.golangci.yml --timeout=10m --issues-exit-code=1 --max-issues-per-linter=0 --sort-results ./..."
27+
only-new-issues: true
28+
args: "-c ./.golangci.yml --timeout=10m --issues-exit-code=1 --sort-results ./..."

.github/workflows/lint_pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
main:
1212
name: Validate PR title
13-
runs-on: ubuntu-22.04
13+
runs-on: ubuntu-latest
1414
steps:
1515
- uses: amannn/action-semantic-pull-request@v5
1616
env:

.github/workflows/release.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
validate:
1515
if: github.event.workflow_run.event == 'push' && github.event.workflow_run.conclusion == 'success' && github.repository_owner == 'armadaproject'
1616
name: "Validate revision"
17-
runs-on: ubuntu-22.04
17+
runs-on: ubuntu-latest
1818

1919
steps:
2020
- name: "Checkout"
21-
uses: "actions/checkout@v3"
21+
uses: "actions/checkout@v4"
2222
with:
2323
fetch-depth: 0
2424

@@ -40,22 +40,23 @@ jobs:
4040
release:
4141
name: "Release"
4242
needs: validate
43-
runs-on: ubuntu-22.04
43+
runs-on: ubuntu-latest
4444
environment: armada-dockerhub
4545

4646
steps:
4747
- name: Checkout
48-
uses: actions/checkout@v3
48+
uses: actions/checkout@v4
4949
with:
5050
fetch-depth: 0
5151

5252
- name: Fetch Git tags
5353
run: git fetch --force --tags
5454

55-
- name: Set up Go
56-
uses: actions/setup-go@v4
55+
- name: Setup Go
56+
id: setup-go
57+
uses: ./.github/actions/setup-go-cache
5758
with:
58-
go-version: "1.20"
59+
cache-prefix: go-build
5960

6061
- name: Set up Docker Buildx
6162
id: buildx
@@ -78,18 +79,17 @@ jobs:
7879
echo "GORELEASER_PREVIOUS_TAG=$previous_tag" >> $GITHUB_ENV
7980
8081
- name: Run GoReleaser
81-
uses: goreleaser/goreleaser-action@v4
82+
uses: goreleaser/goreleaser-action@v5
8283
with:
8384
distribution: goreleaser
84-
version: v1.19.2
85+
version: v1.21.1
8586
args: "-f ./.goreleaser.yaml release --clean"
8687
env:
8788
FULL_RELEASE: true
8889
DOCKER_REPO: "gresearch"
8990
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
9091
DOCKER_BUILDX_BUILDER: "${{ steps.buildx.outputs.name }}"
91-
DOCKER_BUILDX_CACHE_FROM: "type=gha"
92-
DOCKER_BUILDX_CACHE_TO: "type=gha,mode=max"
92+
9393
invoke-chart-push:
9494
name: Invoke Chart push
9595
needs: release

.github/workflows/release_rc.yml

+10-11
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
validate:
1515
if: github.event.workflow_run.event == 'push' && github.event.workflow_run.conclusion == 'success' && github.repository_owner == 'armadaproject'
1616
name: "Validate revision"
17-
runs-on: ubuntu-22.04
17+
runs-on: ubuntu-latest
1818

1919
steps:
2020
- name: "Checkout"
21-
uses: "actions/checkout@v3"
21+
uses: "actions/checkout@v4"
2222
with:
2323
fetch-depth: 0
2424

@@ -40,19 +40,20 @@ jobs:
4040
release:
4141
name: Release
4242
needs: validate
43-
runs-on: "ubuntu-22.04"
43+
runs-on: "ubuntu-latest"
4444
environment: armada-dockerhub
4545

4646
steps:
4747
- name: "Checkout"
48-
uses: "actions/checkout@v3"
48+
uses: "actions/checkout@v4"
4949
with:
5050
fetch-depth: 0
5151

52-
- name: Setup Golang with Cache
53-
uses: magnetikonline/action-golang-cache@v4
52+
- name: Setup Go
53+
id: setup-go
54+
uses: ./.github/actions/setup-go-cache
5455
with:
55-
go-version: "1.20"
56+
cache-prefix: go-build
5657

5758
- name: Set up Docker Buildx
5859
id: buildx
@@ -65,17 +66,15 @@ jobs:
6566
password: "${{ secrets.DOCKERHUB_PASS }}"
6667

6768
- name: "Run GoReleaser"
68-
uses: "goreleaser/goreleaser-action@v4"
69+
uses: "goreleaser/goreleaser-action@v5"
6970
with:
7071
distribution: "goreleaser"
71-
version: v1.19.2
72+
version: v1.21.1
7273
args: "-f ./.goreleaser.yaml release --snapshot --skip-sbom --skip-sign --clean"
7374
env:
7475
DOCKER_REPO: "gresearch"
7576
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
7677
DOCKER_BUILDX_BUILDER: "${{ steps.buildx.outputs.name }}"
77-
DOCKER_BUILDX_CACHE_FROM: "type=gha"
78-
DOCKER_BUILDX_CACHE_TO: "type=gha,mode=max"
7978

8079
- name: Run Docker push script
8180
run: ./scripts/docker-push.sh -t '${{ github.event.workflow_run.head_sha }}'

0 commit comments

Comments
 (0)