-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run the IrSO functional job on ironic-images changes
Signed-off-by: Dmitry Tantsur <[email protected]>
- Loading branch information
Showing
2 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Functional | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
|
||
jobs: | ||
functional: | ||
runs-on: ubuntu-latest | ||
env: | ||
LOGDIR: /tmp/logs | ||
steps: | ||
- name: Update repositories | ||
run: sudo apt update | ||
- name: Install podman | ||
run: sudo apt install -y podman | ||
- uses: actions/checkout@v4 | ||
with: | ||
path: ironic-image | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: metal3-io/ironic-standalone-operator | ||
path: ironic-standalone-operator | ||
- name: Calculate go version | ||
id: vars | ||
run: echo "go_version=$(make -sC ironic-standalone-operator go-version)" >> $GITHUB_OUTPUT | ||
- name: Set up Go | ||
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 | ||
with: | ||
go-version: ${{ steps.vars.outputs.go_version }} | ||
- uses: helm/kind-action@v1 | ||
with: | ||
cluster_name: kind | ||
config: ironic-standalone-operator/test/kind.yaml | ||
- name: Prepare tests | ||
run: cd ironic-standalone-operator && ./test/prepare.sh | ||
- name: Run tests | ||
run: ironic-image/hack/ci-e2e.sh | ||
env: | ||
IRSO_PATH: "${{ github.workspace }}/ironic-standalone-operator" | ||
- name: Collect logs | ||
run: ironic-standalone-operator/test/collect-logs.sh | ||
if: always() | ||
- name: Upload logs artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: functional | ||
path: /tmp/logs/* | ||
if: always() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
set -eux -o pipefail | ||
|
||
REPO_ROOT=$(realpath "$(dirname "${BASH_SOURCE[0]}")/..") | ||
cd "${REPO_ROOT}" || exit 1 | ||
|
||
if [[ -z "${IRSO_PATH:-}" ]]; then | ||
IRSO_PATH="$(mktemp -td irso-XXXXXXXX)" | ||
fi | ||
IRSO_REPO="${IRSO_REPO:-https://github.com/metal3-io/ironic-standalone-operator}" | ||
IRSO_BRANCH="${IRSO_BRANCH:-main}" | ||
export IRONIC_CUSTOM_IMAGE=localhost/ironic:test | ||
|
||
if [[ ! -e "${IRSO_PATH}/.git" ]]; then | ||
git clone "${IRSO_REPO}" -b "${IRSO_BRANCH}" "${IRSO_PATH}" | ||
fi | ||
|
||
podman build -t "${IRONIC_CUSTOM_IMAGE}" . | ||
|
||
archive="$(mktemp --suffix=.tar)" | ||
podman save "${IRONIC_CUSTOM_IMAGE}" > "${archive}" | ||
kind load image-archive -v 2 "${archive}" | ||
rm -f "${archive}" | ||
|
||
cd "${IRSO_PATH}/test" | ||
# shellcheck disable=SC1091 | ||
. testing.env | ||
export IRONIC_CUSTOM_VERSION=latest | ||
|
||
exec go test -timeout 60m |