Skip to content

Commit 4a49f74

Browse files
committed
chore: test ci
test ci.
1 parent 7c5ed1e commit 4a49f74

File tree

7 files changed

+350
-161
lines changed

7 files changed

+350
-161
lines changed

.github/workflows/ci.yaml

Lines changed: 94 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2024-03-11T06:25:06Z by kres latest.
3+
# Generated on 2024-10-22T14:55:10Z by kres 6d3cad4.
44

55
name: default
66
concurrency:
@@ -13,7 +13,10 @@ concurrency:
1313
- release-*
1414
tags:
1515
- v*
16-
workflow_dispatch:
16+
pull_request:
17+
branches:
18+
- main
19+
- release-*
1720
jobs:
1821
default:
1922
permissions:
@@ -28,28 +31,44 @@ jobs:
2831
if: (!startsWith(github.head_ref, 'renovate/') && !startsWith(github.head_ref, 'dependabot/'))
2932
outputs:
3033
labels: ${{ steps.retrieve-pr-labels.outputs.result }}
31-
services:
32-
buildkitd:
33-
image: moby/buildkit:v0.12.5
34-
options: --privileged
35-
ports:
36-
- 1234:1234
37-
volumes:
38-
- /var/lib/buildkit/${{ github.repository }}:/var/lib/buildkit
39-
- /usr/etc/buildkit/buildkitd.toml:/etc/buildkit/buildkitd.toml
4034
steps:
35+
- name: gather-system-info
36+
id: system-info
37+
uses: kenchan0130/[email protected]
38+
continue-on-error: true
39+
- name: print-system-info
40+
run: |
41+
MEMORY_GB=$((${{ steps.system-info.outputs.totalmem }}/1024/1024/1024))
42+
43+
OUTPUTS=(
44+
"CPU Core: ${{ steps.system-info.outputs.cpu-core }}"
45+
"CPU Model: ${{ steps.system-info.outputs.cpu-model }}"
46+
"Hostname: ${{ steps.system-info.outputs.hostname }}"
47+
"NodeName: ${NODE_NAME}"
48+
"Kernel release: ${{ steps.system-info.outputs.kernel-release }}"
49+
"Kernel version: ${{ steps.system-info.outputs.kernel-version }}"
50+
"Name: ${{ steps.system-info.outputs.name }}"
51+
"Platform: ${{ steps.system-info.outputs.platform }}"
52+
"Release: ${{ steps.system-info.outputs.release }}"
53+
"Total memory: ${MEMORY_GB} GB"
54+
)
55+
56+
for OUTPUT in "${OUTPUTS[@]}";do
57+
echo "${OUTPUT}"
58+
done
59+
continue-on-error: true
4160
- name: checkout
4261
uses: actions/checkout@v4
4362
- name: Unshallow
4463
run: |
4564
git fetch --prune --unshallow
4665
- name: Set up Docker Buildx
66+
id: setup-buildx
4767
uses: docker/setup-buildx-action@v3
4868
with:
4969
driver: remote
50-
endpoint: tcp://127.0.0.1:1234
51-
buildkitd-flags: --debug
52-
timeout-minutes: 1
70+
endpoint: tcp://buildkit-amd64.ci.svc.cluster.local:1234
71+
timeout-minutes: 10
5372
- name: base
5473
run: |
5574
make base
@@ -59,9 +78,6 @@ jobs:
5978
- name: unit-tests-race
6079
run: |
6180
make unit-tests-race
62-
- name: coverage
63-
run: |
64-
make coverage
6581
- name: roller-derby
6682
run: |
6783
make roller-derby
@@ -86,12 +102,12 @@ jobs:
86102
run: |
87103
make image-roller-derby
88104
- name: push-roller-derby-latest
89-
if: github.event_name != 'pull_request'
105+
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
90106
env:
91107
PLATFORM: linux/amd64,linux/arm64
92108
PUSH: "true"
93109
run: |
94-
make image-roller-derby TAG=latest
110+
make image-roller-derby IMAGE_TAG=latest
95111
- name: dummy
96112
run: |
97113
make dummy
@@ -113,8 +129,9 @@ jobs:
113129
- name: Generate Checksums
114130
if: startsWith(github.ref, 'refs/tags/')
115131
run: |
116-
sha256sum _out/roller-derby-* > _out/sha256sum.txt
117-
sha512sum _out/roller-derby-* > _out/sha512sum.txt
132+
cd _out
133+
sha256sum roller-derby-* > sha256sum.txt
134+
sha512sum roller-derby-* > sha512sum.txt
118135
- name: release-notes
119136
if: startsWith(github.ref, 'refs/tags/')
120137
run: |
@@ -134,27 +151,44 @@ jobs:
134151
if: contains(fromJSON(needs.default.outputs.labels), 'integration/e2e') || contains(fromJSON(needs.default.outputs.labels), 'integration/dummy')
135152
needs:
136153
- default
137-
services:
138-
buildkitd:
139-
image: moby/buildkit:v0.12.5
140-
options: --privileged
141-
ports:
142-
- 1234:1234
143-
volumes:
144-
- /var/lib/buildkit/${{ github.repository }}:/var/lib/buildkit
145-
- /usr/etc/buildkit/buildkitd.toml:/etc/buildkit/buildkitd.toml
146154
steps:
155+
- name: gather-system-info
156+
id: system-info
157+
uses: kenchan0130/[email protected]
158+
continue-on-error: true
159+
- name: print-system-info
160+
run: |
161+
MEMORY_GB=$((${{ steps.system-info.outputs.totalmem }}/1024/1024/1024))
162+
163+
OUTPUTS=(
164+
"CPU Core: ${{ steps.system-info.outputs.cpu-core }}"
165+
"CPU Model: ${{ steps.system-info.outputs.cpu-model }}"
166+
"Hostname: ${{ steps.system-info.outputs.hostname }}"
167+
"NodeName: ${NODE_NAME}"
168+
"Kernel release: ${{ steps.system-info.outputs.kernel-release }}"
169+
"Kernel version: ${{ steps.system-info.outputs.kernel-version }}"
170+
"Name: ${{ steps.system-info.outputs.name }}"
171+
"Platform: ${{ steps.system-info.outputs.platform }}"
172+
"Release: ${{ steps.system-info.outputs.release }}"
173+
"Total memory: ${MEMORY_GB} GB"
174+
)
175+
176+
for OUTPUT in "${OUTPUTS[@]}";do
177+
echo "${OUTPUT}"
178+
done
179+
continue-on-error: true
147180
- name: checkout
148181
uses: actions/checkout@v4
149182
- name: Unshallow
150183
run: |
151184
git fetch --prune --unshallow
152185
- name: Set up Docker Buildx
186+
id: setup-buildx
153187
uses: docker/setup-buildx-action@v3
154188
with:
155189
driver: remote
156-
endpoint: tcp://localhost:1234
157-
timeout-minutes: 1
190+
endpoint: tcp://buildkit-amd64.ci.svc.cluster.local:1234
191+
timeout-minutes: 10
158192
- name: dummy
159193
run: |
160194
make dummy
@@ -164,27 +198,44 @@ jobs:
164198
if: contains(fromJSON(needs.default.outputs.labels), 'integration/e2e') || contains(fromJSON(needs.default.outputs.labels), 'integration/dummy-a')
165199
needs:
166200
- default
167-
services:
168-
buildkitd:
169-
image: moby/buildkit:v0.12.5
170-
options: --privileged
171-
ports:
172-
- 1234:1234
173-
volumes:
174-
- /var/lib/buildkit/${{ github.repository }}:/var/lib/buildkit
175-
- /usr/etc/buildkit/buildkitd.toml:/etc/buildkit/buildkitd.toml
176201
steps:
202+
- name: gather-system-info
203+
id: system-info
204+
uses: kenchan0130/[email protected]
205+
continue-on-error: true
206+
- name: print-system-info
207+
run: |
208+
MEMORY_GB=$((${{ steps.system-info.outputs.totalmem }}/1024/1024/1024))
209+
210+
OUTPUTS=(
211+
"CPU Core: ${{ steps.system-info.outputs.cpu-core }}"
212+
"CPU Model: ${{ steps.system-info.outputs.cpu-model }}"
213+
"Hostname: ${{ steps.system-info.outputs.hostname }}"
214+
"NodeName: ${NODE_NAME}"
215+
"Kernel release: ${{ steps.system-info.outputs.kernel-release }}"
216+
"Kernel version: ${{ steps.system-info.outputs.kernel-version }}"
217+
"Name: ${{ steps.system-info.outputs.name }}"
218+
"Platform: ${{ steps.system-info.outputs.platform }}"
219+
"Release: ${{ steps.system-info.outputs.release }}"
220+
"Total memory: ${MEMORY_GB} GB"
221+
)
222+
223+
for OUTPUT in "${OUTPUTS[@]}";do
224+
echo "${OUTPUT}"
225+
done
226+
continue-on-error: true
177227
- name: checkout
178228
uses: actions/checkout@v4
179229
- name: Unshallow
180230
run: |
181231
git fetch --prune --unshallow
182232
- name: Set up Docker Buildx
233+
id: setup-buildx
183234
uses: docker/setup-buildx-action@v3
184235
with:
185236
driver: remote
186-
endpoint: tcp://localhost:1234
187-
timeout-minutes: 1
237+
endpoint: tcp://buildkit-amd64.ci.svc.cluster.local:1234
238+
timeout-minutes: 10
188239
- name: dummy
189240
run: |
190241
make dummy
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
2+
#
3+
# Generated on 2024-10-22T14:53:51Z by kres 6d3cad4.
4+
5+
name: slack-notify
6+
"on":
7+
workflow_run:
8+
workflows:
9+
- default
10+
types:
11+
- completed
12+
jobs:
13+
slack-notify:
14+
runs-on:
15+
- self-hosted
16+
- generic
17+
if: github.event.workflow_run.conclusion != 'skipped'
18+
steps:
19+
- name: Get PR number
20+
id: get-pr-number
21+
if: github.event.workflow_run.event == 'pull_request'
22+
env:
23+
GH_TOKEN: ${{ github.token }}
24+
run: |
25+
echo pull_request_number=$(gh pr view -R ${{ github.repository }} ${{ github.event.workflow_run.head_repository.owner.login }}:${{ github.event.workflow_run.head_branch }} --json number --jq .number) >> $GITHUB_OUTPUT
26+
- name: Slack Notify
27+
uses: slackapi/slack-github-action@v1
28+
with:
29+
channel-id: proj-talos-maintainers
30+
payload: |
31+
{
32+
"attachments": [
33+
{
34+
"color": "${{ github.event.workflow_run.conclusion == 'success' && '#2EB886' || github.event.workflow_run.conclusion == 'failure' && '#A30002' || '#FFCC00' }}",
35+
"fallback": "test",
36+
"blocks": [
37+
{
38+
"type": "section",
39+
"fields": [
40+
{
41+
"type": "mrkdwn",
42+
"text": "${{ github.event.workflow_run.event == 'pull_request' && format('*Pull Request:* {0} (`{1}`)\n<{2}/pull/{3}|{4}>', github.repository, github.ref_name, github.event.repository.html_url, steps.get-pr-number.outputs.pull_request_number, github.event.workflow_run.display_title) || format('*Build:* {0} (`{1}`)\n<{2}/commit/{3}|{4}>', github.repository, github.ref_name, github.event.repository.html_url, github.sha, github.event.workflow_run.display_title) }}"
43+
},
44+
{
45+
"type": "mrkdwn",
46+
"text": "*Status:*\n`${{ github.event.workflow_run.conclusion }}`"
47+
}
48+
]
49+
},
50+
{
51+
"type": "section",
52+
"fields": [
53+
{
54+
"type": "mrkdwn",
55+
"text": "*Author:*\n`${{ github.actor }}`"
56+
},
57+
{
58+
"type": "mrkdwn",
59+
"text": "*Event:*\n`${{ github.event.workflow_run.event }}`"
60+
}
61+
]
62+
},
63+
{
64+
"type": "divider"
65+
},
66+
{
67+
"type": "actions",
68+
"elements": [
69+
{
70+
"type": "button",
71+
"text": {
72+
"type": "plain_text",
73+
"text": "Logs"
74+
},
75+
"url": "${{ github.event.workflow_run.html_url }}"
76+
},
77+
{
78+
"type": "button",
79+
"text": {
80+
"type": "plain_text",
81+
"text": "Commit"
82+
},
83+
"url": "${{ github.event.repository.html_url }}/commit/${{ github.sha }}"
84+
}
85+
]
86+
}
87+
]
88+
}
89+
]
90+
}
91+
env:
92+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

0 commit comments

Comments
 (0)