Skip to content

Commit

Permalink
CI: opt chart test flows
Browse files Browse the repository at this point in the history
Signed-off-by: wuhuizuo <[email protected]>
  • Loading branch information
wuhuizuo committed Dec 4, 2023
1 parent c3d36b5 commit a127379
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 48 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/charts_lint-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Charts Lint Test

on:
pull_request:
branches: [main]
paths:
- "charts/**"

jobs:
chart-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.8.1

- uses: actions/setup-python@v4
with:
python-version: 3.7

- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint)
run: |
# from sub `charts` dir to uplevel dir.
for d in `find . -name charts -type d | sort -r`; do
ct lint --all --debug --chart-dirs=${d#./}
done
17 changes: 1 addition & 16 deletions .github/workflows/charts_test-bazel-remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [main]
paths:
- "charts/bazel-remote/**"
- ".github/workflows/chart*"

jobs:
chart-test:
runs-on: ubuntu-latest
Expand All @@ -27,21 +27,6 @@ jobs:
- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint)
run: |
# from sub `charts` dir to uplevel dir.
for d in `find . -name charts -type d | sort -r`; do
ct lint --all --debug --chart-dirs=${d#./}
done
- name: Setup Kubernetes
uses: engineerd/[email protected]
with:
Expand Down
17 changes: 1 addition & 16 deletions .github/workflows/charts_test-jenkins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [main]
paths:
- "charts/jenkins/**"
- ".github/workflows/chart*"

jobs:
chart-test:
runs-on: ubuntu-latest
Expand All @@ -27,21 +27,6 @@ jobs:
- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint)
run: |
# from sub `charts` dir to uplevel dir.
for d in `find . -name charts -type d | sort -r`; do
ct lint --all --debug --chart-dirs=${d#./}
done
- name: Setup Kubernetes
uses: engineerd/[email protected]
with:
Expand Down
17 changes: 1 addition & 16 deletions .github/workflows/charts_test-prow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [main]
paths:
- "charts/prow/**"
- ".github/workflows/chart*"

jobs:
chart-test:
runs-on: ubuntu-latest
Expand All @@ -27,21 +27,6 @@ jobs:
- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint)
run: |
# from sub `charts` dir to uplevel dir.
for d in `find . -name charts -type d | sort -r`; do
ct lint --all --debug --chart-dirs=${d#./}
done
- name: Setup Kubernetes
uses: engineerd/[email protected]
with:
Expand Down

0 comments on commit a127379

Please sign in to comment.