mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 10:25:47 +02:00
feat: move lint test chart to seperate action and trigger it on reg tests (#2536)
* move lint test chart to a separate action * use it in regression tests
This commit is contained in:
parent
7b4591cc7d
commit
4c0055ddf0
3 changed files with 69 additions and 52 deletions
61
.github/actions/lint-test-chart/action.yml
vendored
Normal file
61
.github/actions/lint-test-chart/action.yml
vendored
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
name: Lint test chart
|
||||||
|
description: "Run lint test chart"
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up Helm
|
||||||
|
uses: azure/setup-helm@v3
|
||||||
|
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: "3.9"
|
||||||
|
check-latest: true
|
||||||
|
|
||||||
|
- name: Chart Rendering Tests
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
go test -v ./contrib/charts/dragonfly/...
|
||||||
|
|
||||||
|
- name: Set up chart-testing
|
||||||
|
uses: helm/chart-testing-action@v2.6.1
|
||||||
|
|
||||||
|
- name: Run chart-testing (list-changed)
|
||||||
|
id: list-changed
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
changed=$(ct list-changed --config .ct.yaml)
|
||||||
|
if [[ -n "$changed" ]]; then
|
||||||
|
echo "changed=true" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Run chart-testing (lint)
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
ct \
|
||||||
|
lint \
|
||||||
|
--config .ct.yaml \
|
||||||
|
${{github.event_name == 'workflow_dispatch' && '--all'}} ;
|
||||||
|
|
||||||
|
- name: Create kind cluster
|
||||||
|
uses: helm/kind-action@v1.8.0
|
||||||
|
|
||||||
|
- name: Getting cluster ready
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
kubectl label nodes chart-testing-control-plane key/node-kind=high-memory
|
||||||
|
|
||||||
|
- name: Run chart-testing (install)
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
ct \
|
||||||
|
install \
|
||||||
|
--config .ct.yaml \
|
||||||
|
--debug \
|
||||||
|
--helm-extra-set-args "--set=image.repository=ghcr.io/${{ github.repository }},probes=null" \
|
||||||
|
${{github.event_name == 'workflow_dispatch' && '--all'}} ;
|
54
.github/workflows/ci.yml
vendored
54
.github/workflows/ci.yml
vendored
|
@ -146,55 +146,5 @@ jobs:
|
||||||
lint-test-chart:
|
lint-test-chart:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v3
|
||||||
uses: actions/checkout@v3
|
- uses: ./.github/actions/lint-test-chart
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Set up Helm
|
|
||||||
uses: azure/setup-helm@v3
|
|
||||||
|
|
||||||
- uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: "3.9"
|
|
||||||
check-latest: true
|
|
||||||
|
|
||||||
- name: Chart Rendering Tests
|
|
||||||
run: |
|
|
||||||
go test -v ./contrib/charts/dragonfly/...
|
|
||||||
|
|
||||||
- name: Set up chart-testing
|
|
||||||
uses: helm/chart-testing-action@v2.6.1
|
|
||||||
|
|
||||||
- name: Run chart-testing (list-changed)
|
|
||||||
id: list-changed
|
|
||||||
run: |
|
|
||||||
changed=$(ct list-changed --config .ct.yaml)
|
|
||||||
if [[ -n "$changed" ]]; then
|
|
||||||
echo "changed=true" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Run chart-testing (lint)
|
|
||||||
run: |
|
|
||||||
ct \
|
|
||||||
lint \
|
|
||||||
--config .ct.yaml \
|
|
||||||
${{github.event_name == 'workflow_dispatch' && '--all'}} ;
|
|
||||||
|
|
||||||
- if: steps.list-changed.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
|
|
||||||
name: Create kind cluster
|
|
||||||
uses: helm/kind-action@v1.8.0
|
|
||||||
|
|
||||||
- if: steps.list-changed.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
|
|
||||||
name: Getting cluster ready
|
|
||||||
run: |
|
|
||||||
kubectl label nodes chart-testing-control-plane key/node-kind=high-memory
|
|
||||||
|
|
||||||
- name: Run chart-testing (install)
|
|
||||||
run: |
|
|
||||||
ct \
|
|
||||||
install \
|
|
||||||
--config .ct.yaml \
|
|
||||||
--debug \
|
|
||||||
--helm-extra-set-args "--set=image.repository=ghcr.io/${{ github.repository }},probes=null" \
|
|
||||||
${{github.event_name == 'workflow_dispatch' && '--all'}} ;
|
|
||||||
|
|
6
.github/workflows/regression-tests.yml
vendored
6
.github/workflows/regression-tests.yml
vendored
|
@ -48,3 +48,9 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: logs
|
name: logs
|
||||||
path: /tmp/dragonfly.*
|
path: /tmp/dragonfly.*
|
||||||
|
|
||||||
|
lint-test-chart:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/lint-test-chart
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue