Skip to content

Commit

Permalink
chore(ci): kresify gh actions
Browse files Browse the repository at this point in the history
Kresify, only handle gh workflows.

Signed-off-by: Noel Georgi <git@frezbo.dev>
  • Loading branch information
frezbo committed Apr 27, 2024
1 parent 05fd042 commit 5292d6b
Show file tree
Hide file tree
Showing 7 changed files with 387 additions and 3 deletions.
193 changes: 193 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-04-27T13:51:36Z by kres ebc009d-dirty.

name: default
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
"on":
push:
branches:
- main
- release-*
tags:
- v*
pull_request:
branches:
- main
- release-*
jobs:
default:
permissions:
actions: read
contents: write
issues: read
packages: write
pull-requests: read
runs-on:
- self-hosted
- generic
if: (!startsWith(github.head_ref, 'renovate/') && !startsWith(github.head_ref, 'dependabot/'))
services:
buildkitd:
image: moby/buildkit:v0.13.1
options: --privileged
ports:
- 1234:1234
volumes:
- /var/lib/buildkit/${{ github.repository }}:/var/lib/buildkit
- /usr/etc/buildkit/buildkitd.toml:/etc/buildkit/buildkitd.toml
steps:
- name: checkout
uses: actions/checkout@v4
- name: Unshallow
run: |
git fetch --prune --unshallow
- name: Set up Docker Buildx
id: setup-buildx
uses: docker/setup-buildx-action@v3
with:
driver: remote
endpoint: tcp://127.0.0.1:1234
timeout-minutes: 10
- name: external-artifacts
run: |
make external-artifacts
- name: generate
run: |
make generate docs
- name: uki-certs
run: |
make uki-certs PLATFORM=linux/amd64
- name: check-dirty
run: |
make check-dirty
- name: build
run: |
make talosctl-all kernel sd-boot sd-stub initramfs installer imager talos _out/integration-test-linux-amd64 PLATFORM=linux/amd64,linux/arm64 IMAGE_REGISTRY=registry.dev.siderolabs.io PUSH=true
- name: lint
run: |
make lint
- name: talosctl-cni-bundle
run: |
make talosctl-cni-bundle
- name: iso
run: |
make iso secureboot-iso IMAGE_REGISTRY=registry.dev.siderolabs.io
- name: images-essential
run: |
make images-essential IMAGE_REGISTRY=registry.dev.siderolabs.io
- name: unit-tests
run: |
make unit-tests
- name: unit-tests-race
run: |
make unit-tests-race
- name: coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
make coverage
continue-on-error: true
timeout-minutes: 1
- name: Generate executable list
run: |
find _out -type f -executable > _out/executable-artifacts
- name: save-artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts
path: |
_out
retention-days: "5"
e2e-docker-short:
permissions:
actions: read
contents: write
issues: read
packages: write
pull-requests: read
runs-on:
- self-hosted
- generic
if: (!startsWith(github.head_ref, 'renovate/') && !startsWith(github.head_ref, 'dependabot/'))
needs:
- default
steps:
- name: checkout
uses: actions/checkout@v4
- name: Unshallow
run: |
git fetch --prune --unshallow
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: artifacts
path: _out
- name: Fix artifact permissions
run: |
xargs -a _out/executable-artifacts -I {} chmod +x {}
- name: e2e-docker
run: |
make e2e-docker IMAGE_REGISTRY=registry.dev.siderolabs.io SHORT_INTEGRATION_TEST=yes
e2e-iso:
permissions:
actions: read
contents: write
issues: read
packages: write
pull-requests: read
runs-on:
- self-hosted
- generic
if: (!startsWith(github.head_ref, 'renovate/') && !startsWith(github.head_ref, 'dependabot/'))
needs:
- default
steps:
- name: checkout
uses: actions/checkout@v4
- name: Unshallow
run: |
git fetch --prune --unshallow
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: artifacts
path: _out
- name: Fix artifact permissions
run: |
xargs -a _out/executable-artifacts -I {} chmod +x {}
- name: e2e-iso
run: |
sudo -E make e2e-iso IMAGE_REGISTRY=registry.dev.siderolabs.io
e2e-qemu-short:
permissions:
actions: read
contents: write
issues: read
packages: write
pull-requests: read
runs-on:
- self-hosted
- talos
if: (!startsWith(github.head_ref, 'renovate/') && !startsWith(github.head_ref, 'dependabot/'))
needs:
- default
steps:
- name: checkout
uses: actions/checkout@v4
- name: Unshallow
run: |
git fetch --prune --unshallow
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: artifacts
path: _out
- name: Fix artifact permissions
run: |
xargs -a _out/executable-artifacts -I {} chmod +x {}
- name: e2e-qemu
run: |
sudo -E make e2e-qemu IMAGE_REGISTRY=registry.dev.siderolabs.io SHORT_INTEGRATION_TEST=yes
92 changes: 92 additions & 0 deletions .github/workflows/slack-notify.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-04-27T09:00:21Z by kres ebc009d-dirty.

name: slack-notify
"on":
workflow_run:
workflows:
- default
types:
- completed
jobs:
slack-notify:
runs-on:
- self-hosted
- generic
if: github.event.workflow_run.conclusion != 'skipped'
steps:
- name: Get PR number
id: get-pr-number
if: github.event.workflow_run.event == 'pull_request'
env:
GH_TOKEN: ${{ github.token }}
run: |
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
- name: Slack Notify
uses: slackapi/slack-github-action@v1
with:
channel-id: proj-talos-maintainers
payload: |
{
"attachments": [
{
"color": "${{ github.event.workflow_run.conclusion == 'success' && '#2EB886' || github.event.workflow_run.conclusion == 'failure' && '#A30002' || '#FFCC00' }}",
"fallback": "test",
"blocks": [
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"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) }}"
},
{
"type": "mrkdwn",
"text": "*Status:*\n`${{ github.event.workflow_run.conclusion }}`"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Author:*\n`${{ github.actor }}`"
},
{
"type": "mrkdwn",
"text": "*Event:*\n`${{ github.event.workflow_run.event }}`"
}
]
},
{
"type": "divider"
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Logs"
},
"url": "${{ github.event.workflow_run.html_url }}"
},
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Commit"
},
"url": "${{ github.event.repository.html_url }}/commit/${{ github.sha }}"
}
]
}
]
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
94 changes: 94 additions & 0 deletions .kres.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
kind: auto.CI
spec:
compileGHWorkflowsOnly: true
---
kind: common.GHWorkflow
spec:
jobs:
- name: default
setupBuildx: true
runners:
- self-hosted
- generic
steps:
- name: external-artifacts
- name: generate
command: generate docs
- name: uki-certs
arguments:
- PLATFORM=linux/amd64
- name: check-dirty
- name: build
command: talosctl-all kernel sd-boot sd-stub initramfs installer imager talos _out/integration-test-linux-amd64
arguments:
- PLATFORM=linux/amd64,linux/arm64
- IMAGE_REGISTRY=registry.dev.siderolabs.io
- PUSH=true
- name: lint
- name: talosctl-cni-bundle
- name: iso
command: iso secureboot-iso
arguments:
- IMAGE_REGISTRY=registry.dev.siderolabs.io
- name: images-essential
arguments:
- IMAGE_REGISTRY=registry.dev.siderolabs.io
- name: unit-tests
- name: unit-tests-race
- name: coverage
environment:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
timeoutMinutes: 1
continueOnError: true
- name: save-artifacts
artifactStep:
type: upload
artifactPath: _out
- name: e2e-iso
depends:
- default
runners:
- self-hosted
- generic
steps:
- name: download-artifacts
artifactStep:
type: download
artifactPath: _out
- name: e2e-iso
withSudo: true
arguments:
- IMAGE_REGISTRY=registry.dev.siderolabs.io
- name: e2e-qemu-short
depends:
- default
runners:
- self-hosted
- talos
steps:
- name: download-artifacts
artifactStep:
type: download
artifactPath: _out
- name: e2e-qemu
withSudo: true
arguments:
- IMAGE_REGISTRY=registry.dev.siderolabs.io
- SHORT_INTEGRATION_TEST=yes
- name: e2e-docker-short
depends:
- default
runners:
- self-hosted
- generic
steps:
- name: download-artifacts
artifactStep:
type: download
artifactPath: _out
- name: e2e-docker
withSudo: false
arguments:
- IMAGE_REGISTRY=registry.dev.siderolabs.io
- SHORT_INTEGRATION_TEST=yes
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,11 @@ unit-tests: ## Performs unit tests.
unit-tests-race: ## Performs unit tests with race detection enabled.
@$(MAKE) target-$@ TARGET_ARGS="--allow security.insecure" PLATFORM=linux/amd64


.PHONY: coverage
coverage: ## Upload coverage data to codecov.io.
bash -c "bash <(curl -s https://codecov.io/bash) -f $(ARTIFACTS)/coverage.txt -X fix"

$(ARTIFACTS)/$(INTEGRATION_TEST_DEFAULT_TARGET)-amd64:
@$(MAKE) local-$(INTEGRATION_TEST_DEFAULT_TARGET) DEST=$(ARTIFACTS) PLATFORM=linux/amd64 WITH_RACE=true NAME=Client PUSH=false

Expand Down
Loading

0 comments on commit 5292d6b

Please sign in to comment.