chore: restructure workflows
This commit is contained in:
parent
1b692d28cc
commit
785339c7a5
4 changed files with 48 additions and 41 deletions
|
@ -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 }}
|
|
|
@ -2,4 +2,5 @@ chart-dirs:
|
||||||
- charts
|
- charts
|
||||||
remote: origin
|
remote: origin
|
||||||
target-branch: main
|
target-branch: main
|
||||||
check-version-increment: false
|
check-version-increment: true
|
||||||
|
validate-maintainers: false
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
name: Chart
|
name: Chart Validation
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
paths:
|
||||||
pull_request:
|
- 'charts/**'
|
||||||
branches:
|
branches:
|
||||||
- 'main'
|
- 'main'
|
||||||
push:
|
push:
|
||||||
|
paths:
|
||||||
|
- 'charts/**'
|
||||||
branches:
|
branches:
|
||||||
- 'main'
|
- 'main'
|
||||||
|
|
||||||
|
@ -18,18 +20,21 @@ jobs:
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Run chart-testing (list-changed)
|
- name: List changed charts
|
||||||
id: list-changed
|
id: changed-charts
|
||||||
run: |
|
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
|
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
|
fi
|
||||||
|
outputs:
|
||||||
|
reposChanged: ${{ steps.changed-charts.outputs.reposChanged }}
|
||||||
|
changesExist: ${{ env.changesExist }}
|
||||||
|
|
||||||
- name: Run chart-testing (lint)
|
validation:
|
||||||
run: ct --config .forgejo/ct.yaml lint
|
needs: chart-testing
|
||||||
|
if: needs.chart-testing.outputs.changesExist == 'true'
|
||||||
polaris-audit:
|
|
||||||
runs-on: flakes-action
|
runs-on: flakes-action
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
@ -37,18 +42,26 @@ jobs:
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Run audit
|
- name: Process Changed Repositories
|
||||||
run: |
|
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:
|
echo "Auditing $repo"
|
||||||
runs-on: flakes-action
|
polaris audit --helm-chart "$repo" \
|
||||||
steps:
|
--helm-values "$repo/values.yaml" \
|
||||||
- name: Checkout
|
--format pretty \
|
||||||
uses: actions/checkout@v2
|
--set-exit-code-on-danger \
|
||||||
with:
|
--set-exit-code-below-score 90
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Use pluto
|
echo "Checking deprecated apiVersions for $repo"
|
||||||
run: |
|
helm template "$repo" -f "$repo/ci/pluto-values.yaml" | pluto detect - --ignore-deprecations
|
||||||
helm template ./charts/well-known -f ./charts/well-known/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
|
||||||
|
|
|
@ -5,12 +5,20 @@ vars:
|
||||||
sh: "git rev-parse --show-toplevel"
|
sh: "git rev-parse --show-toplevel"
|
||||||
|
|
||||||
tasks:
|
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:
|
test:
|
||||||
silent: false
|
silent: false
|
||||||
interactive: true
|
interactive: true
|
||||||
cmds:
|
cmds:
|
||||||
- act --artifact-server-path /tmp/artifacts --container-architecture linux/amd64
|
- act --artifact-server-path /tmp/artifacts --container-architecture
|
||||||
|
linux/amd64
|
||||||
|
|
||||||
validate:
|
validate:
|
||||||
desc: Validate charts
|
desc: Validate charts
|
||||||
|
|
Reference in a new issue