8000 [ci] separate build and testing jobs by kvaps · Pull Request #1005 · cozystack/cozystack · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[ci] separate build and testing jobs #1005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pull-requests-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
registry: ghcr.io

- name: Run tests
run: make test
run: make manifests && make test

finalize:
name: Finalize Release
Expand Down
32 changes: 30 additions & 2 deletions .github/workflows/pull-requests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Comment on lines +40 to +45
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify that the build step produces the installer at _out/assets.

This upload step assumes make build outputs _out/assets/cozystack-installer.yaml. Please confirm the root Makefile’s build target writes the artifact there, otherwise the upload will fail.


🏁 Script executed:

#!/bin/bash
# Confirm that the build target generates the installer in _out/assets/
rg -n "cozystack-installer.yaml" -n Makefile

Length of output: 162


I want to confirm this command is indeed part of the build target in the root Makefile. Let’s grab a few lines of context around it:


🏁 Script executed:

#!/bin/bash
rg -n -B3 -A3 "cozystack-installer.yaml" Makefile

Length of output: 269


Let’s confirm that the build target depends on the manifests step (which generates the installer):


🏁 Script executed:

#!/bin/bash
# Show the build target and its prerequisites
rg -n -C3 "^build:" Makefile

Length of output: 324


Ensure the installer is generated before uploading

The build target in the root Makefile (line 10) only depends on build-deps and builds container images; it never invokes the manifests rule that renders _out/assets/cozystack-installer.yaml (defined on line 41). As written, the upload step will fail because the installer file isn’t produced.

Please address this by either:

  • Adding manifests as a prerequisite of the build target (e.g. build: build-deps manifests), or
  • Inserting an explicit make manifests (or make -C packages/core/installer/ assets) step in your GitHub workflow before the upload.
🤖 Prompt for AI Agents
In .github/workflows/pull-requests.yaml around lines 40 to 45, the upload step
assumes the installer artifact is generated by the build step, but the root
Makefile's build target does not run the manifests rule that creates this
artifact. Fix this by either adding manifests as a prerequisite to the build
target in the Makefile or by adding an explicit step in the GitHub workflow to
run make manifests (or make -C packages/core/installer/ assets) before the
upload step to ensure the installer file exists.

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
3 changes: 2 additions & 1 deletion packages/core/testing/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Loading
0