2023-12-07 15:56:12 +00:00
|
|
|
name: build
|
|
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
pull_request:
|
|
|
|
|
push:
|
|
|
|
|
branches:
|
|
|
|
|
- main
|
|
|
|
|
- release/**
|
|
|
|
|
tags:
|
|
|
|
|
- v*
|
|
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
|
|
env:
|
2024-04-10 21:01:12 +00:00
|
|
|
HELM_VERSION: v3.14.4 # renovate: datasource=github-releases depName=helm packageName=helm/helm
|
2024-03-25 08:31:38 +00:00
|
|
|
HELM_UNITTEST_VERSION: v0.4.4 # renovate: datasource=github-releases depName=helm-unittest packageName=helm-unittest/helm-unittest
|
2024-04-27 13:00:37 +00:00
|
|
|
HELM_CHART_TESTING_VERSION: v3.11.0 # renovate: datasource=github-releases depName=chart-testing packageName=helm/chart-testing
|
2024-02-15 02:02:17 +00:00
|
|
|
KIND_VERSION: v0.22.0 # renovate: datasource=github-releases depName=kind packageName=kubernetes-sigs/kind
|
2024-04-17 21:01:32 +00:00
|
|
|
KUBECTL_VERSION: v1.30.0 # renovate: datasource=github-releases depName=kubectl packageName=kubernetes/kubernetes
|
2023-12-07 15:56:12 +00:00
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
lint-node:
|
|
|
|
|
runs-on: docker
|
|
|
|
|
steps:
|
|
|
|
|
- run: cat /etc/os-release
|
|
|
|
|
|
2024-04-25 13:00:04 +00:00
|
|
|
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
|
2023-12-07 15:56:12 +00:00
|
|
|
with:
|
|
|
|
|
show-progress: false
|
|
|
|
|
|
|
|
|
|
- uses: ./.forgejo/actions/setup
|
|
|
|
|
- uses: ./.forgejo/actions/setup-node
|
|
|
|
|
|
2024-02-07 12:46:49 +01: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
|
|
|
|
|
|
|
|
|
|
lint-helm:
|
|
|
|
|
runs-on: docker
|
|
|
|
|
steps:
|
|
|
|
|
- run: cat /etc/os-release
|
|
|
|
|
|
|
|
|
|
- run: ps axf
|
|
|
|
|
|
2024-04-25 13:00:04 +00:00
|
|
|
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
|
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
|
|
|
|
|
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1
|
|
|
|
|
with:
|
|
|
|
|
version: ${{ env.HELM_CHART_TESTING_VERSION }}
|
|
|
|
|
|
|
|
|
|
- name: install helm
|
2024-04-15 20:00:38 +00:00
|
|
|
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.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:
|
|
|
|
|
runs-on: k8s
|
|
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
|
matrix:
|
|
|
|
|
k8s:
|
|
|
|
|
# from https://hub.docker.com/r/kindest/node/tags
|
2024-02-14 23:01:16 +00:00
|
|
|
- v1.27.11 # renovate: kindest
|
2024-02-15 00:32:14 +00:00
|
|
|
- v1.28.7 # renovate: kindest
|
2024-02-14 22:30:56 +00:00
|
|
|
- v1.29.2 # renovate: kindest
|
2023-12-07 15:56:12 +00:00
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
- run: cat /etc/os-release
|
|
|
|
|
|
2024-04-25 13:00:04 +00:00
|
|
|
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
|
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
|
2024-04-15 20:00:38 +00:00
|
|
|
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
|
2023-12-07 15:56:12 +00:00
|
|
|
with:
|
|
|
|
|
version: ${{ env.HELM_VERSION }}
|
|
|
|
|
|
|
|
|
|
- name: Install chart-testing
|
|
|
|
|
# TODO: pin to version when this is released: https://github.com/helm/chart-testing-action/pull/137
|
2024-04-28 11:00:33 +00:00
|
|
|
uses: helm/chart-testing-action@16c6be374ac50a5ef2faa6a755d2fad76a94c9fd # main
|
2023-12-07 15:56:12 +00:00
|
|
|
with:
|
|
|
|
|
version: ${{ env.HELM_CHART_TESTING_VERSION }}
|
|
|
|
|
|
|
|
|
|
- uses: ./.forgejo/actions/setup-docker
|
|
|
|
|
|
|
|
|
|
- name: Create kind cluster
|
2024-04-23 07:31:15 +00:00
|
|
|
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
|
2023-12-07 15:56:12 +00:00
|
|
|
with:
|
|
|
|
|
node_image: kindest/node:${{ matrix.k8s }}
|
|
|
|
|
kubectl_version: ${{ env.KUBECTL_VERSION }}
|
|
|
|
|
version: ${{ env.KIND_VERSION }}
|
|
|
|
|
|
|
|
|
|
- run: kubectl get no -o wide
|
|
|
|
|
|
|
|
|
|
- name: install chart
|
2024-02-10 00:32:27 +00:00
|
|
|
uses: https://github.com/nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
|
2024-02-07 12:22:17 +01:00
|
|
|
with:
|
|
|
|
|
timeout_minutes: 15
|
|
|
|
|
max_attempts: 3
|
|
|
|
|
retry_on: error
|
|
|
|
|
retry_wait_seconds: 60
|
|
|
|
|
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-04-25 13:00:04 +00:00
|
|
|
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
|
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
|
2024-04-15 20:00:38 +00:00
|
|
|
uses: https://github.com/azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
|
2023-12-07 15:56:12 +00:00
|
|
|
with:
|
2023-12-08 09:50:38 +01: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 12:16:15 +01: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
|
2023-12-07 15:56:12 +00:00
|
|
|
env:
|
2024-01-19 12:16:15 +01: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 14:08:56 +01: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
|
2023-12-07 15:56:12 +00:00
|
|
|
|
|
|
|
|
- name: publish forgejo release
|
2024-02-07 12:46:49 +01:00
|
|
|
run: pnpm forgejo:release
|