[ci] separate build and testing jobs (#1005)

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Chores**
- Improved pull request workflow by separating build and test phases,
enhancing reliability and maintainability of automated checks.
- Updated testing process to use a pre-generated installer artifact,
streamlining test execution and environment setup.
- Enhanced release workflow to generate manifests before running tests,
ensuring up-to-date configurations during verification.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Andrei Kvapil
2025-05-29 18:41:40 +02:00
committed by GitHub
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'