Skip to content

Commit

Permalink
ci: test samples on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalek committed May 13, 2024
1 parent c4cebb1 commit 3dbc588
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 12 deletions.
40 changes: 28 additions & 12 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup go
uses: actions/setup-go@v5
Expand Down Expand Up @@ -70,13 +68,38 @@ jobs:
max_attempts: 3
command: make verify.generators

install-with-kustomize:
samples:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup go
uses: actions/setup-go@v5
with:
fetch-depth: 0
go-version-file: go.mod

- name: Create k8s KinD Cluster
uses: helm/[email protected]

- uses: jdx/mise-action@v2
with:
install: false

- name: Verify installing CRDs via kustomize works
run: make install

- name: Install and delete each sample one by one
run: make test.samples

- name: Verify that uninstalling operator CRDs via kustomize works
run: make uninstall

install-with-kustomize:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup go
uses: actions/setup-go@v5
Expand Down Expand Up @@ -122,8 +145,6 @@ jobs:
steps:
- name: checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: setup golang
uses: actions/setup-go@v5
Expand Down Expand Up @@ -198,8 +219,6 @@ jobs:
steps:
- name: checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: setup golang
uses: actions/setup-go@v5
Expand Down Expand Up @@ -251,8 +270,6 @@ jobs:
steps:
- name: checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: setup golang
uses: actions/setup-go@v5
Expand Down Expand Up @@ -400,8 +417,6 @@ jobs:

- name: checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: download tests report
id: download-coverage
Expand Down Expand Up @@ -431,6 +446,7 @@ jobs:
- install-with-kustomize
- build
- unit-tests
- samples
# - conformance-tests
- integration-tests
- integration-tests-bluegreen
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@ test.conformance:
KGO_RELEASE=$(TAG)
GOTESTFLAGS="$(GOTESTFLAGS)"

.PHONY: test.samples
test.samples: kustomize
find ./config/samples -not -name "kustomization.*" -type f | xargs -I{} bash -c "kubectl apply -f {}; kubectl delete -f {}"

# ------------------------------------------------------------------------------
# Gateway API
# ------------------------------------------------------------------------------
Expand Down

0 comments on commit 3dbc588

Please sign in to comment.