Skip to content

Commit cf87779

Browse files
authored
[ci] separate build and testing jobs (#1005)
Signed-off-by: Andrei Kvapil <[email protected]> <!-- 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 -->
2 parents a9c3a4c + c69135e commit cf87779

3 files changed

Lines changed: 33 additions & 4 deletions

File tree

‎.github/workflows/pull-requests-release.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
registry: ghcr.io
3737

3838
- name: Run tests
39-
run: make test
39+
run: make manifests && make test
4040

4141
finalize:
4242
name: Finalize Release

‎.github/workflows/pull-requests.yaml‎

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ concurrency:
99
cancel-in-progress: true
1010

1111
jobs:
12-
e2e:
13-
name: Build and Test
12+
build:
13+
name: Build
1414
runs-on: [self-hosted]
1515
permissions:
1616
contents: read
@@ -37,5 +37,33 @@ jobs:
3737
- name: Build
3838
run: make build
3939

40+
- name: Upload installer artifact
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: cozystack-installer
44+
path: _out/assets/cozystack-installer.yaml
45+
46+
test:
47+
name: Test
48+
runs-on: [self-hosted]
49+
needs: build
50+
51+
# Never run when the PR carries the "release" label.
52+
if: |
53+
!contains(github.event.pull_request.labels.*.name, 'release')
54+
55+
steps:
56+
- name: Checkout code
57+
uses: actions/checkout@v4
58+
with:
59+
fetch-depth: 0
60+
fetch-tags: true
61+
62+
- name: Download installer artifact
63+
uses: actions/download-artifact@v4
64+
with:
65+
name: cozystack-installer
66+
path: _out/assets/
67+
4068
- name: Test
4169
run: make test

‎packages/core/testing/Makefile‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ image-e2e-sandbox:
3333
test: test-cluster test-apps ## Run the end-to-end tests in existing sandbox
3434

3535
test-cluster: ## Run the end-to-end for creating a cluster
36-
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'
36+
docker cp ../../../_out/assets/cozystack-installer.yaml "${SANDBOX_NAME}":/workspace/_out/assets/cozystack-installer.yaml
37+
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'
3738

3839
test-apps: ## Run the end-to-end tests for apps
3940
docker exec "${SANDBOX_NAME}" sh -c 'cd /workspace && hack/cozytest.sh hack/e2e-apps.bats'

0 commit comments

Comments
 (0)