Skip to content

chore: added build/load image steps and dependency chain #14

chore: added build/load image steps and dependency chain

chore: added build/load image steps and dependency chain #14

Workflow file for this run

name: Test Kratix

Check failure on line 1 in .github/workflows/test-kratix.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/test-kratix.yaml

Invalid workflow file

(Line: 104, Col: 13): Job 'quick-start-test' depends on unknown job 'build-kratix-image'., (Line: 148, Col: 13): Job 'system-test' depends on unknown job 'build-kratix-image'., (Line: 208, Col: 13): Job 'core-test' depends on unknown job 'build-kratix-image'., (Line: 241, Col: 13): Job 'integration-test-git' depends on unknown job 'build-kratix-image'., (Line: 284, Col: 13): Job 'integration-test-bucket' depends on unknown job 'build-kratix-image'.
on:
workflow_dispatch:
inputs:
sha:
description: "Commit sha of Kratix"
required: true
type: string
message:
description: "Commit message"
type: string
required: false
ssh_session:
type: boolean
description: "Run the build with tmate debugging."
required: false
default: false
workflow_call:
inputs:
sha:
required: true
type: string
message:
type: string
required: false
jobs:
unit-tests-and-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout ci repository
uses: actions/checkout@v4
with:
repository: syntasso/ci
- name: Setup Common Environment
uses: ./.github/actions/setup-common
with:
repository: syntasso/kratix
ref: ${{ github.event.inputs.sha }}
path: kratix
ssh_session: ${{ github.event.inputs.ssh_session }}
- name: Unit Tests
run: |
cd kratix
make test
- name: Lint
run: |
cd kratix
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.64.8
./bin/golangci-lint run --config=.golangci-required.yml
- name: Go vulnerability check
run: |
cd kratix
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...
- name: Build Kratix image
run: |
cd kratix
make docker-build
EXPORT_IMAGE_TAR=$(make export-image)
echo "EXPORT_IMAGE_TAR=${EXPORT_IMAGE_TAR}" >> "${GITHUB_ENV}"
- name: Upload Kratix image artifact
uses: actions/upload-artifact@v4
with:
name: kratix-image-${{ github.run_id }}
path: ${{ env.EXPORT_IMAGE_TAR }}
retention-days: 1
build-quick-start-installer-image:
runs-on: ubuntu-latest
needs: [unit-tests-and-lint]
steps:
- name: Checkout ci repository
uses: actions/checkout@v4
with:
repository: syntasso/ci
- name: Setup Common Environment
uses: ./.github/actions/setup-common
with:
repository: syntasso/kratix
ref: ${{ github.event.inputs.sha }}
path: kratix
ssh_session: ${{ github.event.inputs.ssh_session }}
- name: Build quick-start installer image
run: |
cd kratix/hack/kratix-quick-start-installer
QUICK_START_INSTALLER_TAR=$(make export-image)
echo "QUICK_START_INSTALLER_TAR=${QUICK_START_INSTALLER_TAR}" >> "${GITHUB_ENV}"
- name: Upload quick-start installer image artifact
uses: actions/upload-artifact@v4
with:
name: quick-start-installer-image-${{ github.run_id }}
path: ${{ env.QUICK_START_INSTALLER_TAR }}
retention-days: 1
quick-start-test:
runs-on: ubuntu-latest
needs: [build-kratix-image, build-quick-start-installer-image]
steps:
- name: Checkout ci repository
uses: actions/checkout@v4
with:
repository: syntasso/ci
- name: Setup Common Environment
uses: ./.github/actions/setup-common
with:
repository: syntasso/kratix
ref: ${{ github.event.inputs.sha }}
path: kratix
ssh_session: ${{ github.event.inputs.ssh_session }}
- name: Download quick-start installer image artifact
uses: actions/download-artifact@v4
with:
name: quick-start-installer-image-${{ github.run_id }}
path: ${{ runner.temp }}/quick-start-installer-image
- name: Load quick-start installer image
run: |
image_tar=$(ls $RUNNER_TEMP/quick-start-installer-image/*.tar | head -1)
docker load -i "${image_tar}"
- name: Download Kratix image artifact
uses: actions/download-artifact@v4
with:
name: kratix-image-${{ github.run_id }}
path: ${{ runner.temp }}/kratix-image
- name: Load Kratix image
run: |
image_tar=$(ls $RUNNER_TEMP/kratix-image/*.tar)
docker load -i "${image_tar}"
- name: System Tests
run: |
cd kratix
DOCKER_BUILDKIT=1 ACK_GINKGO_RC=true cd hack/kratix-quick-start-installer && make system-test
system-test:
runs-on: ubuntu-latest
needs: [build-kratix-image, build-quick-start-installer-image]
strategy:
fail-fast: false
matrix:
flags:
- name: default
env:
DOCKER_BUILDKIT: "1"
ACK_GINKGO_RC: "true"
- name: ff-promise-upgrade
env:
DOCKER_BUILDKIT: "1"
ACK_GINKGO_RC: "true"
UPGRADE_ENABLED: "true"
name: system-test (${{ matrix.flags.name }})
steps:
- name: Checkout ci repository
uses: actions/checkout@v4
with:
repository: syntasso/ci
- name: Setup Common Environment
uses: ./.github/actions/setup-common
with:
repository: syntasso/kratix
ref: ${{ github.event.inputs.sha }}
path: kratix
ssh_session: ${{ github.event.inputs.ssh_session }}
- name: Download quick-start installer image artifact
uses: actions/download-artifact@v4
with:
name: quick-start-installer-image-${{ github.run_id }}
path: ${{ runner.temp }}/quick-start-installer-image
- name: Load quick-start installer image
run: |
image_tar=$(ls $RUNNER_TEMP/quick-start-installer-image/*.tar | head -1)
docker load -i "${image_tar}"
- name: Download Kratix image artifact
uses: actions/download-artifact@v4
with:
name: kratix-image-${{ github.run_id }}
path: ${{ runner.temp }}/kratix-image
- name: Load Kratix image
run: |
image_tar=$(ls $RUNNER_TEMP/kratix-image/*.tar)
docker load -i "${image_tar}"
- name: System Tests
env: ${{ matrix.flags.env }}
run: |
cd kratix
make system-test
core-test:
runs-on: ubuntu-latest
needs: [build-kratix-image]
steps:
- name: Checkout ci repository
uses: actions/checkout@v4
with:
repository: syntasso/ci
- name: Setup Common Environment
uses: ./.github/actions/setup-common
with:
repository: syntasso/kratix
ref: ${{ github.event.inputs.sha }}
path: kratix
ssh_session: ${{ github.event.inputs.ssh_session }}
- name: Download Kratix image artifact
uses: actions/download-artifact@v4
with:
name: kratix-image-${{ github.run_id }}
path: ${{ runner.temp }}/kratix-image
- name: Load Kratix image
run: |
image_tar=$(ls $RUNNER_TEMP/kratix-image/*.tar)
docker load -i "${image_tar}"
- name: System Tests
run: |
cd kratix
DOCKER_BUILDKIT=1 ACK_GINKGO_RC=true make core-test
integration-test-git:
runs-on: ubuntu-latest
needs: [build-kratix-image]
steps:
- name: Checkout ci repository
uses: actions/checkout@v4
with:
repository: syntasso/ci
- name: Setup Common Environment
uses: ./.github/actions/setup-common
with:
repository: syntasso/kratix
ref: ${{ github.event.inputs.sha }}
path: kratix
ssh_session: ${{ github.event.inputs.ssh_session }}
- name: Download Kratix image artifact
uses: actions/download-artifact@v4
with:
name: kratix-image-${{ github.run_id }}
path: ${{ runner.temp }}/kratix-image
- name: Load Kratix image
run: |
image_tar=$(ls $RUNNER_TEMP/kratix-image/*.tar)
docker load -i "${image_tar}"
- name: Checkout out kratix helm charts
uses: actions/checkout@v4
with:
repository: syntasso/helm-charts
path: kratix/charts
- name: Install Helm
uses: azure/setup-helm@v3
- name: e2e-demo-test-helm-git
run: |
cd kratix
STATE_STORE="git" ./scripts/helm-e2e-test.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
integration-test-bucket:
runs-on: ubuntu-latest
needs: [build-kratix-image]
steps:
- name: Checkout ci repository
uses: actions/checkout@v4
with:
repository: syntasso/ci
- name: Setup Common Environment
uses: ./.github/actions/setup-common
with:
repository: syntasso/kratix
ref: ${{ github.event.inputs.sha }}
path: kratix
ssh_session: ${{ github.event.inputs.ssh_session }}
- name: Download Kratix image artifact
uses: actions/download-artifact@v4
with:
name: kratix-image-${{ github.run_id }}
path: ${{ runner.temp }}/kratix-image
- name: Load Kratix image
run: |
image_tar=$(ls $RUNNER_TEMP/kratix-image/*.tar)
docker load -i "${image_tar}"
- name: Checkout out kratix helm charts
uses: actions/checkout@v4
with:
repository: syntasso/helm-charts
path: kratix/charts
- name: Install Helm
uses: azure/setup-helm@v3
- name: e2e-demo-test-helm-bucket
run: |
cd kratix
STATE_STORE="bucket" ./scripts/helm-e2e-test.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}