Skip to content

Commit

Permalink
chore(ci): codegen check (#89)
Browse files Browse the repository at this point in the history
* chore(ci): codegen check

Signed-off-by: Michael Crenshaw <[email protected]>

* better error message, break things

Signed-off-by: Michael Crenshaw <[email protected]>

* get line number

Signed-off-by: Michael Crenshaw <[email protected]>

* wrong file

Signed-off-by: Michael Crenshaw <[email protected]>

* no need for context

Signed-off-by: Michael Crenshaw <[email protected]>

* tidy

Signed-off-by: Michael Crenshaw <[email protected]>

* codegen

Signed-off-by: Michael Crenshaw <[email protected]>

---------

Signed-off-by: Michael Crenshaw <[email protected]>
  • Loading branch information
crenshaw-dev authored Oct 29, 2024
1 parent 806c2e7 commit e8db5e4
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 9 deletions.
35 changes: 29 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4
- name: Set up Go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # pin@v5
with:
go-version: "1.22"
# see https://github.com/actions/setup-go?tab=readme-ov-file#caching-dependency-files-and-build-outputs
cache-dependency-path: |
go.sum
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4
- name: Get dependencies
run: go mod download
- name: Build
Expand All @@ -39,4 +36,30 @@ jobs:
file: cover.out
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
codegen:
name: Check Codegen
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4
- name: Set up Go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # pin@v5
with:
go-version: "1.22"
- name: go mod tidy
run: |
go mod tidy
if ! diff=$(git diff --exit-code --unified=0 -- go.sum); then
line=$(echo "$diff" | sed -nr 's/@@ -([0-9]+),.*/\1/p' | head -n 1 | tr -d '\n')
echo "::error file=go.sum,line=$line::go.sum is out of date. Run 'go mod tidy' and commit the changes."
exit 1
fi
- name: make build-installer
run: |
make build-installer
if ! git diff --exit-code; then
echo "::error ::Manifests are out of date. Run 'make build-installer' and commit the changes."
exit 1
fi
13 changes: 10 additions & 3 deletions dist/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,6 @@ spec:
- key
type: object
type: array
dryBranch:
type: string
environments:
items:
properties:
Expand Down Expand Up @@ -474,7 +472,6 @@ spec:
type: object
type: array
required:
- dryBranch
- environments
- gitRepositoryRef
type: object
Expand Down Expand Up @@ -529,6 +526,8 @@ spec:
sha:
type: string
time:
description: 'FIXME: docs, is this commit time, first-became-healthy
time, most-recently-observed-healthy time, etc?'
format: date-time
type: string
required:
Expand Down Expand Up @@ -890,6 +889,14 @@ kind: ClusterRole
metadata:
name: promoter-manager-role
rules:
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- list
- watch
- apiGroups:
- promoter.argoproj.io
resources:
Expand Down

0 comments on commit e8db5e4

Please sign in to comment.