chore: restructure workflows

This commit is contained in:
Tommy 2024-11-11 19:38:40 +01:00
parent 1b692d28cc
commit 785339c7a5
Signed by: tommy
SSH key fingerprint: SHA256:1LWgQT3QPHIT29plS8jjXc3S1FcE/4oGvsx3Efxs6Uc
4 changed files with 48 additions and 41 deletions

View file

@ -1,15 +0,0 @@
name: Release
on:
push:
branches:
- 'main'
jobs:
release:
name: Release
uses: stenic/github-workflows/.github/workflows/release-docker-helm.yaml@main
with:
docker_image: "ghcr.io/${{ github.repository }}"
chart_path: './charts/well-known'
secrets:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

View file

@ -2,4 +2,5 @@ chart-dirs:
- charts
remote: origin
target-branch: main
check-version-increment: false
check-version-increment: true
validate-maintainers: false

View file

@ -1,11 +1,13 @@
name: Chart
name: Chart Validation
on:
pull_request:
pull_request:
paths:
- 'charts/**'
branches:
- 'main'
push:
paths:
- 'charts/**'
branches:
- 'main'
@ -18,18 +20,21 @@ jobs:
with:
fetch-depth: 0
- name: Run chart-testing (list-changed)
id: list-changed
- name: List changed charts
id: changed-charts
run: |
changed=$(ct --config .forgejo/ct.yaml list-changed)
changed=$(ct --config .forgejo/ct.yaml list-changed | tr '\n' ' ' | jq -R -s -c 'split(" ") | map(select(length > 0))')
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
echo "changesExist=true" >> $GITHUB_ENV
echo "::set-output name=reposChanged::$changed" # Sets output as a JSON array
fi
outputs:
reposChanged: ${{ steps.changed-charts.outputs.reposChanged }}
changesExist: ${{ env.changesExist }}
- name: Run chart-testing (lint)
run: ct --config .forgejo/ct.yaml lint
polaris-audit:
validation:
needs: chart-testing
if: needs.chart-testing.outputs.changesExist == 'true'
runs-on: flakes-action
steps:
- name: Checkout
@ -37,18 +42,26 @@ jobs:
with:
fetch-depth: 0
- name: Run audit
- name: Process Changed Repositories
run: |
polaris audit --helm-chart ./charts/well-known --helm-values ./charts/well-known/values.yaml --format pretty --set-exit-code-on-danger --set-exit-code-below-score 90
repos='${{ needs.chart-testing.outputs.reposChanged }}'
for repo in $(echo $repos | jq -r '.[]'); do
echo "Linting $repo"
ct --config .forgejo/ct.yaml lint "$repo"
pluto-scan:
runs-on: flakes-action
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
echo "Auditing $repo"
polaris audit --helm-chart "$repo" \
--helm-values "$repo/values.yaml" \
--format pretty \
--set-exit-code-on-danger \
--set-exit-code-below-score 90
- name: Use pluto
run: |
helm template ./charts/well-known -f ./charts/well-known/ci/pluto-values.yaml | pluto detect - --ignore-deprecations
echo "Checking deprecated apiVersions for $repo"
helm template "$repo" -f "$repo/ci/pluto-values.yaml" | pluto detect - --ignore-deprecations
done
#with:
# FORGEJO_API_URL=https://code.252.no/api/v1
# FORGEJO_TOKEN=123
# REPO_OWNER=tommy
# REPO_NAME=charts
# ISSUE_INDEX=115

View file

@ -5,12 +5,20 @@ vars:
sh: "git rev-parse --show-toplevel"
tasks:
act:
interactive: true
env:
DOCKER_HOST: ssh://colima
cmds:
- |
act --container-architecture linux/amd64 -W .forgejo -P flakes-action=code.252.no/tommy/flakes-action:latest
test:
silent: false
interactive: true
cmds:
- act --artifact-server-path /tmp/artifacts --container-architecture linux/amd64
- act --artifact-server-path /tmp/artifacts --container-architecture
linux/amd64
validate:
desc: Validate charts