Skip to content

Commit

Permalink
gha fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Per Goncalves da Silva <[email protected]>
  • Loading branch information
Per Goncalves da Silva committed Jun 11, 2024
1 parent 9d9dc14 commit ca39bec
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
sha: ${{ steps.vars.outputs.sha }}
UPDATE_FIXTURES: ${{ steps.fixtures.outputs.UPDATE_FIXTURES }}
steps:
# checkout code and setup go
- uses: actions/checkout@v4
Expand All @@ -23,12 +24,16 @@ jobs:
go-version-file: "go.mod"
# add the fixtures changed flag (UPDATE_FIXTURES) to the job output to others can use it
- name: Rebuild fixtures if necessary
id: fixtures
run: |
UPDATE_FIXTURES="$(scripts/e2e_test_fixtures.sh --check)"
if [ "${UPDATE_FIXTURES}" == "true" ]; then
# rebuild fixtures and export the images to .tar.gz files with --save
scripts/e2e_test_fixtures.sh --save
fi
# Add UPDATE_FIXTURES to the job output
echo "UPDATE_FIXTURES=${UPDATE_FIXTURES}" >> $GITHUB_OUTPUT
# build binaries and image for e2e test (includes experimental features)
- name: Build OLM Image
Expand Down Expand Up @@ -100,10 +105,8 @@ jobs:
KIND_CLUSTER_NAME="kind-olmv0-${i}" \
KIND_CREATE_OPTS="--kubeconfig=${E2E_KUBECONFIG_ROOT}/kubeconfig-${i}" \
HELM_INSTALL_OPTS="--kubeconfig ${E2E_KUBECONFIG_ROOT}/kubeconfig-${i}" \
UPDATE_FIXTURES="${{ needs.build.outputs.UPDATE_FIXTURES }}" \
make kind-create deploy;
if [ "${{ needs.build.outputs.UPDATE_FIXTURES }}" == "true" ]; then
scripts/e2e_test_fixtures.sh --kind-load
fi
done
# run non-flakes if matrix-id is not 'flakes'
Expand Down Expand Up @@ -156,6 +159,12 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Docker Login
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@ kind-create: kind-clean #HELP Create a new kind cluster $KIND_CLUSTER_NAME (defa
.PHONY: deploy
OLM_IMAGE := quay.io/operator-framework/olm:local
deploy: $(KIND) $(HELM) #HELP Deploy OLM to kind cluster $KIND_CLUSTER_NAME (default: kind-olmv0) using $OLM_IMAGE (default: quay.io/operator-framework/olm:local)
$(KIND) load docker-image $(OLM_IMAGE) --name $(KIND_CLUSTER_NAME); \
$(KIND) load docker-image $(OLM_IMAGE) --name $(KIND_CLUSTER_NAME)
@if [ "${UPDATE_FIXTURES}" = "true" ]; then \
scripts/e2e_test_fixtures.sh --kind-load --skip-build; \
fi
$(HELM) upgrade --install olm deploy/chart \
--set debug=true \
--set olm.image.ref=$(OLM_IMAGE) \
Expand Down
1 change: 0 additions & 1 deletion scripts/e2e_test_fixtures.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ while [ $# -gt 0 ]; do
*)
printf "*************************\n"
printf "* Error: Invalid argument.\n"
# shellcheck disable=SC2059
printf "* Usage: %s [--opm-version=version] [--check] [--push] [--container-runtime=runtime] [--registry=registry] [--target-branch=branch] [--kind-load] [--save] [--skip-build] \n" "$0"
printf "\n"
printf "\t--opm-version: opm version to build the fixtures against, e.g. 1.39.0\n"
Expand Down

0 comments on commit ca39bec

Please sign in to comment.