[ci] separate build and testing jobs

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
This commit is contained in:
Andrei Kvapil
2025-05-29 17:10:06 +02:00
parent 0664370218
commit c69135e0e5
3 changed files with 33 additions and 4 deletions

View File

@@ -36,7 +36,7 @@ jobs:
registry: ghcr.io
- name: Run tests
run: make test
run: make manifests && make test
finalize:
name: Finalize Release

View File

@@ -9,8 +9,8 @@ concurrency:
cancel-in-progress: true
jobs:
e2e:
name: Build and Test
build:
name: Build
runs-on: [self-hosted]
permissions:
contents: read
@@ -37,5 +37,33 @@ jobs:
- name: Build
run: make build
- name: Upload installer artifact
uses: actions/upload-artifact@v4
with:
name: cozystack-installer
path: _out/assets/cozystack-installer.yaml
test:
name: Test
runs-on: [self-hosted]
needs: build
# Never run when the PR carries the "release" label.
if: |
!contains(github.event.pull_request.labels.*.name, 'release')
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Download installer artifact
uses: actions/download-artifact@v4
with:
name: cozystack-installer
path: _out/assets/
- name: Test
run: make test

View File

@@ -33,7 +33,8 @@ image-e2e-sandbox:
test: test-cluster test-apps ## Run the end-to-end tests in existing sandbox
test-cluster: ## Run the end-to-end for creating a cluster
docker exec "${SANDBOX_NAME}" sh -c 'cd /workspace && export COZYSTACK_INSTALLER_YAML=$$(helm template -n cozy-system installer ./packages/core/installer) && hack/cozytest.sh hack/e2e-cluster.bats'
docker cp ../../../_out/assets/cozystack-installer.yaml "${SANDBOX_NAME}":/workspace/_out/assets/cozystack-installer.yaml
docker exec "${SANDBOX_NAME}" sh -c 'cd /workspace && export COZYSTACK_INSTALLER_YAML=$$(cat /workspace/_out/assets/cozystack-installer.yaml) && hack/cozytest.sh hack/e2e-cluster.bats'
test-apps: ## Run the end-to-end tests for apps
docker exec "${SANDBOX_NAME}" sh -c 'cd /workspace && hack/cozytest.sh hack/e2e-apps.bats'