2023-12-07 15:56:12 +00:00
|
|
|
name: build
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2024-05-29 06:25:13 +00:00
|
|
|
- maint/**
|
2023-12-07 15:56:12 +00:00
|
|
|
tags:
|
|
|
|
- v*
|
2024-09-25 06:47:03 +00:00
|
|
|
workflow_dispatch:
|
2023-12-07 15:56:12 +00:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
env:
|
2025-03-13 16:41:52 +00:00
|
|
|
HELM_VERSION: v3.17.2 # renovate: datasource=github-releases depName=helm packageName=helm/helm
|
2025-01-27 23:42:23 +00:00
|
|
|
HELM_UNITTEST_VERSION: v0.7.2 # renovate: datasource=github-releases depName=helm-unittest packageName=helm-unittest/helm-unittest
|
2025-01-13 12:30:46 +00:00
|
|
|
HELM_CHART_TESTING_VERSION: v3.12.0 # renovate: datasource=github-releases depName=chart-testing packageName=helm/chart-testing
|
2025-03-12 04:42:26 +00:00
|
|
|
KUBECTL_VERSION: v1.32.3 # renovate: datasource=github-releases depName=kubectl packageName=kubernetes/kubernetes
|
2024-08-16 13:02:56 +00:00
|
|
|
CT_GITHUB_GROUPS: true
|
2023-12-07 15:56:12 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
lint-node:
|
|
|
|
runs-on: docker
|
|
|
|
steps:
|
|
|
|
- run: cat /etc/os-release
|
|
|
|
|
2024-10-23 15:00:42 +00:00
|
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
2023-12-07 15:56:12 +00:00
|
|
|
with:
|
|
|
|
show-progress: false
|
2024-11-01 15:10:12 +00:00
|
|
|
fetch-depth: 0 # Important for changelog
|
|
|
|
filter: blob:none # We don't need all blobs
|
2023-12-07 15:56:12 +00:00
|
|
|
|
|
|
|
- uses: ./.forgejo/actions/setup
|
|
|
|
- uses: ./.forgejo/actions/setup-node
|
|
|
|
|
2024-02-07 11:46:49 +00:00
|
|
|
- run: pnpm prettier
|
|
|
|
- run: pnpm markdownlint .
|
2023-12-07 15:56:12 +00:00
|
|
|
- run: make readme
|
|
|
|
- run: git diff --exit-code --name-only README.md
|
|
|
|
|
2024-11-01 15:10:12 +00:00
|
|
|
- name: changelog
|
|
|
|
run: |
|
|
|
|
pnpm changelog ${{ github.ref_type == 'tag' && 'true' || '' }}
|
|
|
|
|
2023-12-07 15:56:12 +00:00
|
|
|
lint-helm:
|
|
|
|
runs-on: docker
|
|
|
|
steps:
|
|
|
|
- run: cat /etc/os-release
|
|
|
|
|
|
|
|
- run: ps axf
|
|
|
|
|
2024-10-23 15:00:42 +00:00
|
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
2023-12-07 15:56:12 +00:00
|
|
|
with:
|
|
|
|
show-progress: false
|
|
|
|
fetch-depth: 0
|
2024-03-25 09:38:22 +00:00
|
|
|
filter: blob:none # We don't need all blobs
|
2023-12-07 15:56:12 +00:00
|
|
|
|
|
|
|
- uses: ./.forgejo/actions/setup
|
|
|
|
|
|
|
|
- name: install chart-testing
|
2025-01-20 11:47:58 +00:00
|
|
|
uses: helm/chart-testing-action@0d28d3144d3a25ea2cc349d6e59901c4ff469b3b # v2.7.0
|
2023-12-07 15:56:12 +00:00
|
|
|
with:
|
|
|
|
version: ${{ env.HELM_CHART_TESTING_VERSION }}
|
|
|
|
|
|
|
|
- name: install helm
|
2025-02-18 07:37:24 +00:00
|
|
|
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0
|
2023-12-07 15:56:12 +00:00
|
|
|
with:
|
|
|
|
version: ${{ env.HELM_VERSION }}
|
|
|
|
|
|
|
|
- name: install helm-unittest
|
|
|
|
run: helm plugin install --version ${{ env.HELM_UNITTEST_VERSION }} https://github.com/helm-unittest/helm-unittest
|
|
|
|
|
|
|
|
- run: helm dependency build
|
|
|
|
|
|
|
|
- run: yamllint -f colored .
|
|
|
|
- run: helm lint
|
|
|
|
- run: helm template --debug gitea-helm .
|
|
|
|
- run: make unittests
|
|
|
|
- run: ct lint --config tools/ct.yml --charts .
|
|
|
|
|
|
|
|
e2e:
|
2024-08-16 12:58:57 +00:00
|
|
|
needs:
|
|
|
|
- lint-node
|
|
|
|
- lint-helm
|
2023-12-07 15:56:12 +00:00
|
|
|
runs-on: k8s
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-08-16 12:58:57 +00:00
|
|
|
k3s:
|
2024-09-11 14:32:34 +00:00
|
|
|
# https://github.com/k3s-io/k3s/branches
|
|
|
|
# oldest supported version
|
2024-10-29 01:01:31 +00:00
|
|
|
- v1.28.15+k3s1 # renovate: k3s
|
2024-09-11 14:32:34 +00:00
|
|
|
# https://github.com/k3s-io/k3s/blob/master/channel.yaml#L3-L4
|
|
|
|
# stable version
|
2025-02-27 19:41:25 +00:00
|
|
|
- v1.31.6+k3s1 # renovate: k3s
|
2024-09-11 14:32:34 +00:00
|
|
|
# newest version
|
2025-02-27 19:41:25 +00:00
|
|
|
- v1.32.2+k3s1 # renovate: k3s
|
2023-12-07 15:56:12 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- run: cat /etc/os-release
|
|
|
|
|
2024-10-23 15:00:42 +00:00
|
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
2023-12-07 15:56:12 +00:00
|
|
|
with:
|
|
|
|
show-progress: false
|
|
|
|
fetch-depth: 0
|
2024-03-25 09:38:22 +00:00
|
|
|
filter: blob:none # We don't need all blobs
|
2023-12-07 15:56:12 +00:00
|
|
|
|
|
|
|
- uses: ./.forgejo/actions/setup
|
|
|
|
|
|
|
|
- name: install helm
|
2025-02-18 07:37:24 +00:00
|
|
|
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0
|
2023-12-07 15:56:12 +00:00
|
|
|
with:
|
|
|
|
version: ${{ env.HELM_VERSION }}
|
|
|
|
|
|
|
|
- name: Install chart-testing
|
2025-01-20 11:47:58 +00:00
|
|
|
uses: helm/chart-testing-action@0d28d3144d3a25ea2cc349d6e59901c4ff469b3b # v2.7.0
|
2023-12-07 15:56:12 +00:00
|
|
|
with:
|
|
|
|
version: ${{ env.HELM_CHART_TESTING_VERSION }}
|
|
|
|
|
2024-08-16 12:58:57 +00:00
|
|
|
- uses: ./.forgejo/actions/setup-k3s
|
2023-12-07 15:56:12 +00:00
|
|
|
with:
|
2024-08-16 12:58:57 +00:00
|
|
|
version: ${{ matrix.k3s }}
|
2023-12-07 15:56:12 +00:00
|
|
|
|
|
|
|
- run: kubectl get no -o wide
|
|
|
|
|
|
|
|
- name: install chart
|
2025-02-25 14:11:38 +00:00
|
|
|
uses: https://github.com/nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
|
2024-02-07 11:22:17 +00:00
|
|
|
with:
|
2024-08-22 10:05:50 +00:00
|
|
|
timeout_minutes: 15
|
2024-02-07 11:22:17 +00:00
|
|
|
max_attempts: 3
|
|
|
|
retry_on: error
|
2024-08-16 07:15:28 +00:00
|
|
|
retry_wait_seconds: 120
|
2024-02-07 11:22:17 +00:00
|
|
|
polling_interval_seconds: 5
|
|
|
|
command: ct install --config tools/ct.yml --charts .
|
2023-12-07 15:56:12 +00:00
|
|
|
|
|
|
|
# # Catch-all required check for test matrix
|
|
|
|
test-success:
|
|
|
|
needs:
|
|
|
|
- lint-node
|
|
|
|
- lint-helm
|
|
|
|
- e2e
|
|
|
|
runs-on: docker
|
|
|
|
timeout-minutes: 1
|
|
|
|
if: always()
|
|
|
|
steps:
|
|
|
|
- name: Fail for failed or cancelled lint-node
|
|
|
|
if: |
|
|
|
|
needs.lint-node.result == 'failure' ||
|
|
|
|
needs.lint-node.result == 'cancelled'
|
|
|
|
run: exit 1
|
|
|
|
- name: Fail for failed or cancelled lint-helm
|
|
|
|
if: |
|
|
|
|
needs.lint-helm.result == 'failure' ||
|
|
|
|
needs.lint-helm.result == 'cancelled'
|
|
|
|
run: exit 1
|
|
|
|
- name: Fail for failed or cancelled e2e
|
|
|
|
if: |
|
|
|
|
needs.e2e.result == 'failure' ||
|
|
|
|
needs.e2e.result == 'cancelled'
|
|
|
|
run: exit 1
|
|
|
|
|
|
|
|
publish:
|
|
|
|
runs-on: docker
|
|
|
|
needs:
|
|
|
|
- test-success
|
|
|
|
|
|
|
|
if: ${{ github.ref_type == 'tag' }}
|
|
|
|
|
|
|
|
steps:
|
2024-10-23 15:00:42 +00:00
|
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
2023-12-07 15:56:12 +00:00
|
|
|
with:
|
|
|
|
show-progress: false
|
2024-01-16 22:02:47 +00:00
|
|
|
fetch-depth: 0 # Important for changelog
|
|
|
|
filter: blob:none # We don't need all blobs
|
2023-12-07 15:56:12 +00:00
|
|
|
|
|
|
|
- uses: ./.forgejo/actions/setup
|
|
|
|
- uses: ./.forgejo/actions/setup-node
|
|
|
|
|
|
|
|
- name: install helm
|
2025-02-18 08:11:47 +00:00
|
|
|
uses: https://github.com/azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0
|
2023-12-07 15:56:12 +00:00
|
|
|
with:
|
2023-12-08 08:50:38 +00:00
|
|
|
version: ${{ env.HELM_VERSION }}
|
2023-12-07 15:56:12 +00:00
|
|
|
|
|
|
|
- run: helm dependency build
|
|
|
|
- run: helm package --version "${GITHUB_REF_NAME#v}" -d tmp/ ./
|
|
|
|
|
2024-01-19 11:16:15 +00:00
|
|
|
- name: login to registries
|
|
|
|
run: |
|
|
|
|
echo ${CODEBERG_TOKEN} | helm registry login -u viceice --password-stdin codeberg.org/forgejo-contrib
|
|
|
|
echo ${FORGEJO_TOKEN} | helm registry login -u viceice --password-stdin code.forgejo.org/forgejo-contrib
|
2024-05-30 10:41:10 +00:00
|
|
|
echo ${FORGEJO_TOKEN} | helm registry login -u viceice --password-stdin code.forgejo.org/forgejo-helm
|
2023-12-07 15:56:12 +00:00
|
|
|
env:
|
2024-01-19 11:16:15 +00:00
|
|
|
CODEBERG_TOKEN: ${{secrets.API_TOKEN}}
|
|
|
|
FORGEJO_TOKEN: ${{secrets.FORGEJO_API_TOKEN}}
|
2023-12-07 15:56:12 +00:00
|
|
|
|
|
|
|
- name: publish forgejo helm chart
|
2024-01-19 13:08:56 +00:00
|
|
|
run: |
|
|
|
|
helm push tmp/forgejo-${GITHUB_REF_NAME#v}.tgz oci://codeberg.org/forgejo-contrib
|
|
|
|
helm push tmp/forgejo-${GITHUB_REF_NAME#v}.tgz oci://code.forgejo.org/forgejo-contrib
|
2024-05-30 10:41:10 +00:00
|
|
|
helm push tmp/forgejo-${GITHUB_REF_NAME#v}.tgz oci://code.forgejo.org/forgejo-helm
|
2023-12-07 15:56:12 +00:00
|
|
|
|
|
|
|
- name: publish forgejo release
|
2024-02-07 11:46:49 +00:00
|
|
|
run: pnpm forgejo:release
|