ci: adopt release-please, chart-testing and renovate #30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
| name: Pull Request Validation | |
| on: | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| pr-title: | |
| name: Validate PR title | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| pull-requests: read | |
| steps: | |
| # Squash-merge titles become the conventional commits that drive | |
| # release-please, so they must follow the conventional commit format. | |
| - name: Check conventional commit format | |
| uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| lint: | |
| name: Lint and validate | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Helm | |
| uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1 | |
| - name: Setup Python | |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 | |
| with: | |
| python-version: "3.13" | |
| - name: Setup chart-testing | |
| uses: helm/chart-testing-action@6ec842c01de15ebb84c8627d2744a0c2f2755c9f # v2.8.0 | |
| - name: Run chart-testing lint | |
| run: ct lint --config ct.yaml | |
| - name: Validate rendered manifests with kubeconform | |
| run: | | |
| curl -fsSL https://github.com/yannh/kubeconform/releases/download/v0.8.0/kubeconform-linux-amd64.tar.gz | tar -xz kubeconform | |
| helm dependency build charts/trilium | |
| helm template trilium charts/trilium | ./kubeconform -strict -summary -kubernetes-version 1.28.0 | |
| for f in charts/trilium/ci/*-values.yaml; do | |
| echo "--- validating with ${f}" | |
| helm template trilium charts/trilium -f "${f}" | ./kubeconform -strict -summary -kubernetes-version 1.28.0 | |
| done | |
| manifest-diff: | |
| name: Diff rendered manifests against main | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - name: Checkout PR head | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Checkout main | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| ref: main | |
| path: main | |
| - name: Setup Helm | |
| uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1 | |
| - name: Render manifests | |
| run: | | |
| mkdir -p head base | |
| helm dependency build charts/trilium | |
| helm template trilium charts/trilium > head/manifest.yaml | |
| helm dependency build main/charts/trilium | |
| # The fallback flag keeps the diff working against the pre-2.0 chart, | |
| # which refuses to render without an existing claim. | |
| helm template trilium main/charts/trilium > base/manifest.yaml 2>/dev/null \ | |
| || helm template trilium main/charts/trilium --set persistence.data.existingClaim=diff-placeholder > base/manifest.yaml \ | |
| || echo "# main failed to render" > base/manifest.yaml | |
| - name: Comment manifest diff | |
| uses: int128/diff-action@d568d28eca4411ad141d5cd5f84c7b739a0956ce # v2.31.0 | |
| with: | |
| base: base | |
| head: head |