Skip to content

Commit 4e03dcb

Browse files
committed
feat: initial commit
0 parents  commit 4e03dcb

File tree

92 files changed

+41599
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+41599
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Vulnerabilities detected
3+
labels: security
4+
---
5+
High or critical vulnerabilities detected. Scan results are below:
6+
7+
{{ env.RESULTS }}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
#### Describe the bug
11+
A clear and concise description of what the bug is.
12+
13+
#### To Reproduce
14+
Steps to reproduce the behavior:
15+
16+
#### Expected behavior
17+
A clear and concise description of what you expected to happen.
18+
19+
#### Environment
20+
- controller version: [e.g. v1.0.0]
21+
- kubernetes version: [e.g. v1.19.0]
22+
23+
#### Additional context
24+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Change request
3+
about: Propose a change for an already implemented solution
4+
title: ''
5+
labels: change
6+
assignees: ''
7+
8+
---
9+
10+
#### Describe the change
11+
A clear and concise description of what the change is about.
12+
13+
#### Current situation
14+
Describe the current situation.
15+
16+
#### Should
17+
Describe the changes you would like to propose.
18+
19+
#### Additional context
20+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: feature
6+
assignees: ''
7+
8+
---
9+
10+
#### Is your feature request related to a problem? Please describe
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
#### Describe the solution you'd like
14+
A clear and concise description of what you want to happen.
15+
16+
#### Describe alternatives you've considered
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
#### Additional context
20+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Current situation
2+
<!--- Shortly describe the current situation -->
3+
4+
## Proposal
5+
<!--- Describe what this PR is intended to achieve -->

.github/workflows/main.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: main
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
permissions: {}
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Harden Runner
15+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
16+
with:
17+
egress-policy: audit
18+
- name: Checkout
19+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
20+
- name: Setup Go
21+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
22+
with:
23+
go-version: 1.25.x
24+
- name: Tests
25+
run: make test
26+
- name: Send go coverage report
27+
uses: shogo82148/actions-goveralls@e6875f831db61e6abffbd8df91a2eb6cd24b46c9 # v1.9.1
28+
with:
29+
path-to-profile: coverage.out

.github/workflows/pr-actions.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: pr-actions
2+
3+
permissions: {}
4+
5+
on:
6+
pull_request:
7+
branches:
8+
- 'master'
9+
10+
jobs:
11+
ensure-sha-pinned:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Harden Runner
15+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
16+
with:
17+
egress-policy: audit
18+
19+
- name: Checkout
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
- name: Ensure SHA pinned actions
22+
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@4830be28ce81da52ec70d65c552a7403821d98d4 # v3.0.23
23+
with:
24+
# slsa-github-generator requires using a semver tag for reusable workflows.
25+
# See: https://github.com/slsa-framework/slsa-github-generator#referencing-slsa-builders-and-generators
26+
allowlist: |
27+
slsa-framework/slsa-github-generator

.github/workflows/pr-build.yaml

Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
name: pr-build
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
9+
10+
permissions: {}
11+
12+
jobs:
13+
lint-chart:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Harden Runner
17+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
18+
with:
19+
egress-policy: audit
20+
- name: Checkout
21+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Set up Helm
26+
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 #v3.5
27+
with:
28+
version: v3.4.0
29+
30+
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
31+
with:
32+
python-version: 3.13
33+
34+
- name: Set up chart-testing
35+
uses: helm/chart-testing-action@0d28d3144d3a25ea2cc349d6e59901c4ff469b3b # v2.7.0
36+
37+
- name: Run chart-testing (list-changed)
38+
id: list-changed
39+
run: |
40+
changed=$(ct list-changed --target-branch=master --chart-dirs chart)
41+
if [[ -n "$changed" ]]; then
42+
echo "::set-output name=changed::true"
43+
fi
44+
- name: Run chart-testing (lint)
45+
run: ct lint --target-branch=master --chart-dirs chart --check-version-increment=false
46+
47+
fmt:
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Harden Runner
51+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
52+
with:
53+
egress-policy: audit
54+
- name: Checkout
55+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
56+
- name: Setup Go
57+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
58+
with:
59+
go-version: 1.25.x
60+
- name: fmt
61+
run: make fmt
62+
- name: vet
63+
run: make vet
64+
- name: lint
65+
run: make lint
66+
- name: Check if working tree is dirty
67+
run: |
68+
if [[ $(git diff --stat) != '' ]]; then
69+
git --no-pager diff
70+
echo 'run <make test> and commit changes'
71+
exit 1
72+
fi
73+
74+
test:
75+
runs-on: ubuntu-latest
76+
strategy:
77+
matrix:
78+
kubernetes-version:
79+
- "1.27"
80+
- "1.28"
81+
- "1.29"
82+
- "1.30"
83+
steps:
84+
- name: Harden Runner
85+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
86+
with:
87+
egress-policy: audit
88+
- name: Checkout
89+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
90+
- name: Setup Go
91+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
92+
with:
93+
go-version: 1.25.x
94+
- name: run test
95+
run: make test ENVTEST_K8S_VERSION=${{ matrix.kubernetes-version }}
96+
97+
build:
98+
runs-on: ubuntu-latest
99+
outputs:
100+
profiles: ${{ steps.profiles.outputs.matrix }}
101+
steps:
102+
- name: Harden Runner
103+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
104+
with:
105+
egress-policy: audit
106+
- name: Checkout
107+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
108+
- name: Setup Go
109+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
110+
with:
111+
go-version: 1.25.x
112+
- name: build
113+
run: make build
114+
- name: Check if working tree is dirty
115+
run: |
116+
if [[ $(git diff --stat) != '' ]]; then
117+
git --no-pager diff
118+
echo 'run <make test> and commit changes'
119+
exit 1
120+
fi
121+
- name: Build container image
122+
run: |
123+
make docker-build
124+
- name: Create image tarball
125+
run: |
126+
docker save --output apollo-controller-container.tar apollo-controller:latest
127+
- name: Upload image
128+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
129+
with:
130+
name: apollo-controller-container
131+
path: apollo-controller-container.tar
132+
- id: profiles
133+
name: Determine test profiles
134+
run: |
135+
profiles=$(ls config/tests/cases | jq -R -s -c 'split("\n")[:-1]')
136+
echo $profiles
137+
echo "::set-output name=matrix::$profiles"
138+
139+
e2e-tests:
140+
runs-on: ubuntu-latest
141+
needs:
142+
- build
143+
strategy:
144+
matrix:
145+
profile: ${{ fromJson(needs.build.outputs.profiles) }}
146+
steps:
147+
- name: Harden Runner
148+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
149+
with:
150+
egress-policy: audit
151+
- name: Checkout
152+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
153+
- name: Setup Go
154+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
155+
with:
156+
go-version: 1.25.x
157+
- name: Setup Kubernetes
158+
uses: engineerd/setup-kind@aa272fe2a7309878ffc2a81c56cfe3ef108ae7d0 #v0.5.0
159+
with:
160+
version: v0.17.0
161+
- name: Download apollo-controller container
162+
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
163+
with:
164+
name: apollo-controller-container
165+
path: /tmp
166+
- name: Load images
167+
run: |
168+
docker load --input /tmp/apollo-controller-container.tar
169+
docker image ls -a
170+
- name: Setup Kustomize
171+
uses: imranismail/setup-kustomize@2ba527d4d055ab63514ba50a99456fc35684947f # v2.1.0
172+
- name: Run test
173+
run: |
174+
make kind-test TEST_PROFILE=${{ matrix.profile }}
175+
- name: Debug failure
176+
if: failure()
177+
run: |
178+
kubectl -n kube-system describe pods
179+
kubectl -n swagger-system describe pods
180+
kubectl -n swagger-system get all
181+
kubectl -n swagger-system logs deploy/apollo-controller
182+
kubectl -n swagger-system get swaggerhubs -o yaml
183+
184+
test-chart:
185+
runs-on: ubuntu-latest
186+
needs:
187+
- build
188+
- lint-chart
189+
steps:
190+
- name: Harden Runner
191+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
192+
with:
193+
egress-policy: audit
194+
- name: Checkout
195+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
196+
with:
197+
fetch-depth: 0
198+
199+
- name: Set up Helm
200+
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 #v3.5
201+
202+
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
203+
with:
204+
python-version: 3.13
205+
206+
- name: Set up chart-testing
207+
uses: helm/chart-testing-action@0d28d3144d3a25ea2cc349d6e59901c4ff469b3b # v2.7.0
208+
209+
- name: Create kind cluster
210+
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
211+
212+
- name: Download apollo-controller container
213+
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
214+
with:
215+
name: apollo-controller-container
216+
path: /tmp
217+
218+
- name: Load image
219+
run: |
220+
docker load --input /tmp/apollo-controller-container.tar
221+
docker tag apollo-controller:latest ghcr.io/doodlescheduling/apollo-controller:v0.0.0
222+
kind load docker-image ghcr.io/doodlescheduling/apollo-controller:v0.0.0 --name chart-testing
223+
docker image ls -a
224+
225+
- name: Run chart-testing (install)
226+
run: ct install --target-branch=master --chart-dirs chart
227+
228+
test-success:
229+
runs-on: ubuntu-latest
230+
needs: [test, e2e-tests]
231+
steps:
232+
- run: echo "all tests succeeded"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: pr-gorelaser
2+
3+
permissions: {}
4+
5+
on:
6+
pull_request:
7+
branches:
8+
- 'master'
9+
10+
jobs:
11+
validate-config:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Harden Runner
15+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
16+
with:
17+
egress-policy: audit
18+
- name: Checkout
19+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
- name: Validate .goreleaser.yaml
21+
uses: goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3 # v6.2.1
22+
with:
23+
version: latest
24+
args: check
25+
env:
26+
RUNNER_TOKEN: ${{ github.token }}
27+
GITHUB_TOKEN: ${{ secrets.DOODLE_OSS_BOT}}

0 commit comments

Comments
 (0)