CI: Rework conditions.
This commit is contained in:
parent
7bf08b1a05
commit
7f5226221b
2 changed files with 6 additions and 49 deletions
47
.github/workflows/chart.yaml
vendored
47
.github/workflows/chart.yaml
vendored
|
@ -5,6 +5,8 @@ on:
|
|||
branches:
|
||||
- main
|
||||
- release-*
|
||||
paths:
|
||||
- charts/ingress-nginx/Chart.yaml
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
|
@ -12,46 +14,6 @@ permissions:
|
|||
contents: read
|
||||
|
||||
jobs:
|
||||
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: read # for dorny/paths-filter to fetch a list of changed files
|
||||
|
||||
if: github.repository == 'kubernetes/ingress-nginx'
|
||||
|
||||
outputs:
|
||||
docs: ${{ steps.filter.outputs.docs }}
|
||||
charts: ${{ steps.filter.outputs.charts }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Run Artifact Hub lint
|
||||
run: |
|
||||
wget https://github.com/artifacthub/hub/releases/download/v1.5.0/ah_1.5.0_linux_amd64.tar.gz
|
||||
echo 'ad0e44c6ea058ab6b85dbf582e88bad9fdbc64ded0d1dd4edbac65133e5c87da *ah_1.5.0_linux_amd64.tar.gz' | shasum -c
|
||||
tar -xzvf ah_1.5.0_linux_amd64.tar.gz ah
|
||||
./ah lint -p charts/ingress-nginx || exit 1
|
||||
rm -f ./ah ./ah_1.5.0_linux_amd64.tar.gz
|
||||
|
||||
- name: Set up chart-testing
|
||||
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1
|
||||
|
||||
- name: Run chart-testing (lint)
|
||||
run: ct lint --target-branch ${{ github.ref_name }} --config ./.ct.yaml
|
||||
|
||||
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
|
||||
id: filter
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
filters: |
|
||||
charts:
|
||||
- 'charts/ingress-nginx/Chart.yaml'
|
||||
- 'charts/ingress-nginx/values.yaml'
|
||||
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -59,11 +21,6 @@ jobs:
|
|||
permissions:
|
||||
contents: write
|
||||
|
||||
needs:
|
||||
- changes
|
||||
|
||||
if: ${{ needs.changes.outputs.charts == 'true' }}
|
||||
|
||||
steps:
|
||||
- name: Checkout master
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
|
8
.github/workflows/ci.yaml
vendored
8
.github/workflows/ci.yaml
vendored
|
@ -197,8 +197,8 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- changes
|
||||
if: |
|
||||
(needs.changes.outputs.charts == 'true') || (needs.changes.outputs.baseimage == 'true') || ${{ github.event.workflow_dispatch.run_e2e == 'true' }}
|
||||
|
||||
if: fromJSON(needs.changes.outputs.charts) || fromJSON(needs.changes.outputs.baseimage) || fromJSON(github.event.workflow_dispatch.run_e2e)
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
@ -253,8 +253,8 @@ jobs:
|
|||
- changes
|
||||
- build
|
||||
- chart-lint
|
||||
if: |
|
||||
(needs.changes.outputs.charts == 'true') || (needs.changes.outputs.baseimage == 'true') || ${{ github.event.workflow_dispatch.run_e2e == 'true' }}
|
||||
|
||||
if: fromJSON(needs.changes.outputs.charts) || fromJSON(needs.changes.outputs.baseimage) || fromJSON(github.event.workflow_dispatch.run_e2e)
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
|
|
Loading…
Reference in a new issue