Skip to content

Commit e808b89

Browse files
committed
Configure GitHub Actions and e2e test scripts
- Add unified GitHub Actions workflows with path filters - Configure dependabot for all package ecosystems - Remove old .github directories from subdirectories - Install e2e test scripts (setup-e2e.sh, run-e2e.sh, tests.bats)
1 parent cdd8029 commit e808b89

29 files changed

Lines changed: 896 additions & 529 deletions

.github/dependabot.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Dependabot configuration for monorepo
2+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
3+
4+
version: 2
5+
updates:
6+
# Go modules for controller
7+
- package-ecosystem: "gomod"
8+
directory: "/controller"
9+
schedule:
10+
interval: weekly
11+
12+
# Go modules for operator
13+
- package-ecosystem: "gomod"
14+
directory: "/controller/deploy/operator"
15+
schedule:
16+
interval: weekly
17+
18+
# Python dependencies
19+
- package-ecosystem: "pip"
20+
directory: "/python"
21+
schedule:
22+
interval: weekly
23+
24+
# Devcontainers
25+
- package-ecosystem: "devcontainers"
26+
directory: "/"
27+
schedule:
28+
interval: weekly
29+
30+
# GitHub Actions
31+
- package-ecosystem: "github-actions"
32+
directory: "/"
33+
schedule:
34+
interval: weekly
Lines changed: 62 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: Build and push container image
1+
name: Build and push container images
2+
23
on:
34
workflow_dispatch:
45
push:
@@ -7,8 +8,10 @@ on:
78
branches:
89
- main
910
- 'release-*'
11+
merge_group:
1012

1113
env:
14+
PUSH: ${{ github.repository_owner == 'jumpstarter-dev' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release-')) }}
1215
REGISTRY: quay.io
1316
QUAY_ORG: quay.io/jumpstarter-dev
1417

@@ -17,18 +20,35 @@ jobs:
1720
runs-on: ubuntu-latest
1821
permissions:
1922
contents: read
23+
packages: write
24+
attestations: write
25+
id-token: write
2026
strategy:
2127
matrix:
2228
include:
29+
# Controller images
2330
- image_name: jumpstarter-dev/jumpstarter-controller
24-
dockerfile: Dockerfile
25-
context: .
31+
dockerfile: controller/Dockerfile
32+
context: controller
2633
- image_name: jumpstarter-dev/jumpstarter-operator
27-
dockerfile: Dockerfile.operator
28-
context: .
34+
dockerfile: controller/Dockerfile.operator
35+
context: controller
2936
- image_name: jumpstarter-dev/jumpstarter-operator-bundle
30-
dockerfile: deploy/operator/bundle.Dockerfile
31-
context: deploy/operator
37+
dockerfile: controller/deploy/operator/bundle.Dockerfile
38+
context: controller/deploy/operator
39+
# Python images (use repo root context for .git access needed by hatch-vcs)
40+
- image_name: jumpstarter-dev/jumpstarter
41+
dockerfile: python/Dockerfile
42+
context: .
43+
- image_name: jumpstarter-dev/jumpstarter-utils
44+
dockerfile: python/Dockerfile.utils
45+
context: python
46+
- image_name: jumpstarter-dev/jumpstarter-dev
47+
dockerfile: python/.devfile/Containerfile
48+
context: python
49+
- image_name: jumpstarter-dev/jumpstarter-devspace
50+
dockerfile: python/.devfile/Containerfile.client
51+
context: .
3252
steps:
3353
- name: Checkout repository
3454
uses: actions/checkout@v4
@@ -41,6 +61,17 @@ jobs:
4161
VERSION=${VERSION#v} # remove the leading v prefix for version
4262
echo "VERSION=${VERSION}" >> $GITHUB_ENV
4363
echo "VERSION=${VERSION}"
64+
65+
# Convert to PEP 440 compliant version for Python packages
66+
# Format: 0.7.0-1051-g54cd2f08 -> 0.7.0.dev1051+g54cd2f08
67+
if [[ "$VERSION" =~ ^([0-9]+\.[0-9]+\.[0-9]+)-([0-9]+)-g([a-f0-9]+)$ ]]; then
68+
PEP440_VERSION="${BASH_REMATCH[1]}.dev${BASH_REMATCH[2]}+g${BASH_REMATCH[3]}"
69+
else
70+
# If it's already a clean version (e.g., 0.7.0), use as-is
71+
PEP440_VERSION="$VERSION"
72+
fi
73+
echo "PEP440_VERSION=${PEP440_VERSION}" >> $GITHUB_ENV
74+
echo "PEP440_VERSION=${PEP440_VERSION}"
4475
4576
- name: Set build args
4677
id: build-args
@@ -53,6 +84,7 @@ jobs:
5384
echo "BUILD_DATE=${BUILD_DATE}"
5485
5586
- name: Set image tags
87+
if: ${{ env.PUSH == 'true' }}
5688
id: set-tags
5789
run: |
5890
TAGS="${{ env.REGISTRY }}/${{ matrix.image_name }}:${{ env.VERSION }}"
@@ -61,7 +93,7 @@ jobs:
6193
TAGS="$TAGS,${{ env.REGISTRY }}/${{ matrix.image_name }}:latest"
6294
fi
6395
64-
if [[ "${{ github.ref }}" == "refs/heads/release-*" ]]; then
96+
if [[ "${{ github.ref }}" == refs/heads/release-* ]]; then
6597
RELEASE_BRANCH_NAME=$(basename "${{ github.ref }}")
6698
TAGS="$TAGS,${{ env.REGISTRY }}/${{ matrix.image_name }}:${RELEASE_BRANCH_NAME}"
6799
fi
@@ -76,29 +108,46 @@ jobs:
76108

77109
- name: Log in to the Container registry
78110
uses: docker/login-action@v3
111+
if: ${{ env.PUSH == 'true' }}
79112
with:
80113
registry: ${{ env.REGISTRY }}
81114
username: jumpstarter-dev+jumpstarter_ci
82115
password: ${{ secrets.QUAY_TOKEN }}
83116

117+
- name: Extract metadata (tags, labels) for Docker
118+
id: meta
119+
uses: docker/metadata-action@v5
120+
with:
121+
images: ${{ env.REGISTRY }}/${{ matrix.image_name }}
122+
84123
- name: Build and push Docker image
85124
id: push
86125
uses: docker/build-push-action@v6
87126
with:
88127
context: ${{ matrix.context }}
89128
file: ${{ matrix.dockerfile }}
90-
push: true
129+
push: ${{ env.PUSH }}
91130
tags: ${{ steps.set-tags.outputs.tags }}
131+
labels: ${{ steps.meta.outputs.labels }}
92132
platforms: linux/amd64,linux/arm64
93133
cache-from: type=gha
94134
cache-to: type=gha,mode=max
95135
build-args: |
96-
GIT_VERSION=${{ env.VERSION }}
136+
GIT_VERSION=${{ env.PEP440_VERSION }}
97137
GIT_COMMIT=${{ steps.build-args.outputs.git_commit }}
98138
BUILD_DATE=${{ steps.build-args.outputs.build_date }}
99139
100-
publish-helm-charts-containers:
140+
- name: Generate artifact attestation
141+
uses: actions/attest-build-provenance@v1
142+
if: ${{ env.PUSH == 'true' }}
143+
with:
144+
subject-name: ${{ env.REGISTRY }}/${{ matrix.image_name }}
145+
subject-digest: ${{ steps.push.outputs.digest }}
146+
push-to-registry: ${{ env.PUSH }}
147+
148+
publish-helm-charts:
101149
needs: build-and-push-image
150+
if: ${{ github.repository_owner == 'jumpstarter-dev' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release-')) }}
102151
runs-on: ubuntu-latest
103152
steps:
104153
- uses: actions/checkout@v4
@@ -116,8 +165,8 @@ jobs:
116165
run: |
117166
echo packaging ${VERSION}
118167
# patch the sub-chart app-version, because helm package won't do it
119-
sed -i "s/^appVersion:.*/appVersion: $VERSION/" deploy/helm/jumpstarter/charts/jumpstarter-controller/Chart.yaml
120-
helm package ./deploy/helm/jumpstarter --version "${VERSION}" --app-version "${VERSION}"
168+
sed -i "s/^appVersion:.*/appVersion: $VERSION/" controller/deploy/helm/jumpstarter/charts/jumpstarter-controller/Chart.yaml
169+
helm package ./controller/deploy/helm/jumpstarter --version "${VERSION}" --app-version "${VERSION}"
121170
122171
- name: Login helm
123172
env:

python/.github/workflows/build_oci_bundle.yaml renamed to .github/workflows/build-oci-bundle.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Build and push buildroot-based flasher OCI bundle
2+
23
on:
34
workflow_dispatch:
45

@@ -14,17 +15,17 @@ jobs:
1415

1516
- name: Run build_fits.sh
1617
run: |
17-
cd packages/jumpstarter-driver-flashers/oci_bundles/aarch64-itb
18+
cd python/packages/jumpstarter-driver-flashers/oci_bundles/aarch64-itb
1819
./build_fits.sh
1920
2021
- name: Upload FIT artifacts
2122
uses: actions/upload-artifact@v4
2223
with:
2324
name: FIT-images
24-
path: packages/jumpstarter-driver-flashers/oci_bundles/aarch64-itb/data/*.itb
25+
path: python/packages/jumpstarter-driver-flashers/oci_bundles/aarch64-itb/data/*.itb
2526

2627
- name: Run build_bundle.sh for aarch64-itb
2728
run: |
28-
cd packages/jumpstarter-driver-flashers/oci_bundles && dnf install -y oras
29+
cd python/packages/jumpstarter-driver-flashers/oci_bundles && dnf install -y oras
2930
oras login quay.io -u jumpstarter-dev+jumpstarter_ci --password-stdin <<< "${{ secrets.QUAY_TOKEN }}"
3031
./build_bundle.sh quay.io/jumpstarter-dev/jumpstarter-flasher-aarch64-itb:latest aarch64-itb

controller/.github/workflows/check-bundle.yaml renamed to .github/workflows/controller-bundle.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
name: Check Bundle
2+
23
on:
34
pull_request:
45
branches:
56
- main
67
- 'release-*'
8+
paths:
9+
- 'controller/**'
710

811
jobs:
912
check-bundle:
@@ -17,13 +20,13 @@ jobs:
1720
- name: Set up Go
1821
uses: actions/setup-go@v5
1922
with:
20-
go-version: 1.24
23+
go-version: '1.24'
2124

2225
- name: Cache bin directory (deploy/operator)
2326
uses: actions/cache@v4
2427
with:
25-
path: deploy/operator/bin/
26-
key: ${{ runner.os }}-operator-bin-${{ hashFiles('deploy/operator/go.mod') }}
28+
path: controller/deploy/operator/bin/
29+
key: ${{ runner.os }}-operator-bin-${{ hashFiles('controller/deploy/operator/go.mod') }}
2730
restore-keys: |
2831
${{ runner.os }}-operator-bin-
2932
@@ -47,7 +50,7 @@ jobs:
4750
echo "TAG=${TAG}"
4851
4952
- name: Run make bundle
50-
working-directory: deploy/operator
53+
working-directory: controller/deploy/operator
5154
run: |
5255
make bundle IMG="quay.io/jumpstarter-dev/jumpstarter-operator:${TAG}"
5356
@@ -78,7 +81,7 @@ jobs:
7881
git checkout -- . || true
7982
8083
- name: Run make build-installer
81-
working-directory: deploy/operator
84+
working-directory: controller/deploy/operator
8285
run: |
8386
make build-installer
8487
@@ -92,4 +95,3 @@ jobs:
9295
else
9396
echo "No uncommitted changes detected. Installer files are up to date."
9497
fi
95-
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
name: Kind based CI
2+
23
on:
34
workflow_dispatch:
45
pull_request:
56
branches:
67
- main
78
- 'release-*'
9+
paths:
10+
- 'controller/**'
811

912
jobs:
1013
deploy-kind:
@@ -16,6 +19,7 @@ jobs:
1619
fetch-depth: 0
1720

1821
- name: Run make deploy
22+
working-directory: controller
1923
run: make deploy
2024

2125
e2e-test-operator:
@@ -26,5 +30,6 @@ jobs:
2630
with:
2731
fetch-depth: 0
2832

29-
- name: Run make deploy
30-
run: make test-operator-e2e
33+
- name: Run operator e2e test
34+
working-directory: controller
35+
run: make test-operator-e2e
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
name: Unit/Functional tests
1+
name: Controller Unit/Functional tests
2+
23
on:
34
workflow_dispatch:
45
pull_request:
56
branches:
67
- main
78
- 'release-*'
9+
paths:
10+
- 'controller/**'
11+
- 'protocol/**'
812

913
jobs:
1014
tests:
@@ -16,15 +20,16 @@ jobs:
1620
fetch-depth: 0
1721

1822
- name: Run controller tests
23+
working-directory: controller
1924
run: make test
2025

2126
- name: Cache operator bin directory
2227
uses: actions/cache@v4
2328
with:
24-
path: deploy/operator/bin/
25-
key: ${{ runner.os }}-operator-bin-${{ hashFiles('deploy/operator/go.mod') }}
29+
path: controller/deploy/operator/bin/
30+
key: ${{ runner.os }}-operator-bin-${{ hashFiles('controller/deploy/operator/go.mod') }}
2631
restore-keys: |
2732
${{ runner.os }}-operator-bin-
2833
2934
- name: Run operator tests
30-
run: make -C deploy/operator test
35+
run: make -C controller/deploy/operator test

python/.github/workflows/documentation.yaml renamed to .github/workflows/documentation.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
name: documentation
1+
name: Documentation
22

33
on:
44
# Runs on pushes targeting the default branch
55
push:
66
branches: ["main"]
7+
paths:
8+
- 'python/docs/**'
9+
- 'python/packages/**'
710
pull_request:
11+
paths:
12+
- 'python/docs/**'
13+
- 'python/packages/**'
814
merge_group:
915

1016
# Allows you to run this workflow manually from the Actions tab
@@ -25,6 +31,7 @@ concurrency:
2531
defaults:
2632
run:
2733
shell: bash
34+
working-directory: python
2835

2936
jobs:
3037
# Build job
@@ -66,7 +73,7 @@ jobs:
6673
- name: Upload artifact
6774
uses: actions/upload-pages-artifact@v3
6875
with:
69-
path: ./docs/build
76+
path: ./python/docs/build
7077

7178
check-warnings:
7279
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)