Skip to content

Commit 38048bb

Browse files
committed
Check that CRDs are up to date (nginx#156)
1 parent 91843fa commit 38048bb

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,10 @@ concurrency:
2929
jobs:
3030

3131
vars:
32-
name: Get variables
32+
name: Checks and variables
3333
runs-on: ubuntu-20.04
3434
outputs:
3535
sha: ${{ steps.vars.outputs.sha }}
36-
go_version: ${{ steps.vars.outputs.go_version }}
37-
git_tag: ${{ steps.vars.outputs.git_tag }}
3836
version: ${{ steps.vars.outputs.version }}
3937
date: ${{ steps.vars.outputs.date }}
4038
steps:
@@ -44,10 +42,15 @@ jobs:
4442
id: vars
4543
run: |
4644
echo "::set-output name=sha::$(echo ${GITHUB_SHA} | cut -c1-7)"
47-
echo "::set-output name=go_version::$(grep "go 1." go.mod | cut -d " " -f 2)"
48-
echo "::set-output name=git_tag::$(echo ${GITHUB_REF/refs\/tags\//} | tr -d v)"
4945
echo "::set-output name=version::$(grep "VERSION = " Makefile | cut -d " " -f 3)"
5046
echo "::set-output name=date::$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
47+
- name: Setup Golang Environment
48+
uses: actions/setup-go@v3
49+
with:
50+
go-version-file: go.mod
51+
- name: Check if CRDs changed
52+
run: |
53+
make update-crds && git diff --name-only --exit-code deploy/manifests/crds/*
5154
5255
unit-tests:
5356
name: Unit Tests
@@ -59,7 +62,7 @@ jobs:
5962
- name: Setup Golang Environment
6063
uses: actions/setup-go@v3
6164
with:
62-
go-version: ${{ needs.vars.outputs.go_version }}
65+
go-version-file: go.mod
6366
- name: Run Tests
6467
run: make unit-test
6568
- name: Upload Coverage Report
@@ -72,6 +75,7 @@ jobs:
7275
njs-unit-tests:
7376
name: NJS Unit Tests
7477
runs-on: ubuntu-20.04
78+
needs: vars
7579
steps:
7680
- name: Checkout Repository
7781
uses: actions/checkout@v3
@@ -92,7 +96,7 @@ jobs:
9296
- name: Setup Golang Environment
9397
uses: actions/setup-go@v3
9498
with:
95-
go-version: ${{ needs.vars.outputs.go_version }}
99+
go-version-file: go.mod
96100
- name: Build Binary
97101
run: make build
98102
- name: Cache Artifacts

0 commit comments

Comments
 (0)