Skip to content

Commit

Permalink
ci: use output to pass chart_name between jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
FushuWang committed Jul 21, 2023
1 parent f9e055c commit 8c67dc8
Showing 1 changed file with 28 additions and 104 deletions.
132 changes: 28 additions & 104 deletions .github/workflows/chart_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ on:
jobs:
basic-tests:
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.list-changed.outputs.changed }}
chart_name: ${{ steps.list-changed.outputs.chart_name }}

steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -109,16 +113,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 }} --config .ci/ct.yaml)
chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>')
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "chart_name=$chart_name" >> $GITHUB_OUTPUT
fi
- name: Create kind cluster
run: |
./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.20.15
Expand All @@ -128,12 +122,12 @@ jobs:
env:
KIND_VERSION: 0.20.0
SN_IMAGE: streamnative/sn-platform:2.10.4.3
if: steps.list-changed.outputs.changed == 'true'
if: ${{ needs.basic-tests.outputs.changed }} == 'true'


# Install the pulsar operator before testing the sn-platform
- name: Install the pulsar operator
if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform'
if: ${{ needs.basic-tests.outputs.changed }} == 'true' && ${{ needs.basic-tests.outputs.chart_name }} != 'charts/pulsar-operator'
run: |
helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com
helm -n sn-system install sn charts/pulsar-operator --create-namespace
Expand All @@ -146,7 +140,7 @@ jobs:
df -h
- name: Run chart-testing (install)
run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform
run: ct install --debug --config ct.yaml --print-config --charts ${{ needs.basic-tests.outputs.chart_name }}

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
Expand Down Expand Up @@ -183,16 +177,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 }} --config .ci/ct.yaml)
chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>')
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "chart_name=$chart_name" >> $GITHUB_OUTPUT
fi
- name: Create kind cluster
run: |
./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.21.14
Expand All @@ -202,12 +186,12 @@ jobs:
env:
KIND_VERSION: 0.20.0
SN_IMAGE: streamnative/sn-platform:2.10.4.3
if: steps.list-changed.outputs.changed == 'true'
if: ${{ needs.basic-tests.outputs.changed }} == 'true'


# Install the pulsar operator before testing the sn-platform
- name: Install the pulsar operator
if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform'
if: ${{ needs.basic-tests.outputs.changed }} == 'true' && ${{ needs.basic-tests.outputs.chart_name }} != 'charts/pulsar-operator'
run: |
helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com
helm -n sn-system install sn charts/pulsar-operator --create-namespace
Expand All @@ -220,7 +204,7 @@ jobs:
df -h
- name: Run chart-testing (install)
run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform
run: ct install --debug --config ct.yaml --print-config --charts ${{ needs.basic-tests.outputs.chart_name }}

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
Expand Down Expand Up @@ -257,16 +241,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 }} --config .ci/ct.yaml)
chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>')
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "chart_name=$chart_name" >> $GITHUB_OUTPUT
fi
- name: Create kind cluster
run: |
./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.22.17
Expand All @@ -276,12 +250,12 @@ jobs:
env:
KIND_VERSION: 0.20.0
SN_IMAGE: streamnative/sn-platform:2.10.4.3
if: steps.list-changed.outputs.changed == 'true'
if: ${{ needs.basic-tests.outputs.changed }} == 'true'


# Install the pulsar operator before testing the sn-platform
- name: Install the pulsar operator
if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform'
if: ${{ needs.basic-tests.outputs.changed }} == 'true' && ${{ needs.basic-tests.outputs.chart_name }} != 'charts/pulsar-operator'
run: |
helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com
helm -n sn-system install sn charts/pulsar-operator --create-namespace
Expand All @@ -294,7 +268,7 @@ jobs:
df -h
- name: Run chart-testing (install)
run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform
run: ct install --debug --config ct.yaml --print-config --charts ${{ needs.basic-tests.outputs.chart_name }}

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
Expand Down Expand Up @@ -331,16 +305,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 }} --config .ci/ct.yaml)
chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>')
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "chart_name=$chart_name" >> $GITHUB_OUTPUT
fi
- name: Create kind cluster
run: |
./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.23.17
Expand All @@ -350,12 +314,12 @@ jobs:
env:
KIND_VERSION: 0.20.0
SN_IMAGE: streamnative/sn-platform:2.10.4.3
if: steps.list-changed.outputs.changed == 'true'
if: ${{ needs.basic-tests.outputs.changed }} == 'true'


# Install the pulsar operator before testing the sn-platform
- name: Install the pulsar operator
if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform'
if: ${{ needs.basic-tests.outputs.changed }} == 'true' && ${{ needs.basic-tests.outputs.chart_name }} != 'charts/pulsar-operator'
run: |
helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com
helm -n sn-system install sn charts/pulsar-operator --create-namespace
Expand All @@ -368,7 +332,7 @@ jobs:
df -h
- name: Run chart-testing (install)
run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform
run: ct install --debug --config ct.yaml --print-config --charts ${{ needs.basic-tests.outputs.chart_name }}

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
Expand Down Expand Up @@ -405,16 +369,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 }} --config .ci/ct.yaml)
chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>')
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "chart_name=$chart_name" >> $GITHUB_OUTPUT
fi
- name: Create kind cluster
run: |
./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.24.15
Expand All @@ -424,12 +378,12 @@ jobs:
env:
KIND_VERSION: 0.20.0
SN_IMAGE: streamnative/sn-platform:2.10.4.3
if: steps.list-changed.outputs.changed == 'true'
if: ${{ needs.basic-tests.outputs.changed }} == 'true'


# Install the pulsar operator before testing the sn-platform
- name: Install the pulsar operator
if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform'
if: ${{ needs.basic-tests.outputs.changed }} == 'true' && ${{ needs.basic-tests.outputs.chart_name }} != 'charts/pulsar-operator'
run: |
helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com
helm -n sn-system install sn charts/pulsar-operator --create-namespace
Expand All @@ -442,7 +396,7 @@ jobs:
df -h
- name: Run chart-testing (install)
run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform
run: ct install --debug --config ct.yaml --print-config --charts ${{ needs.basic-tests.outputs.chart_name }}

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
Expand Down Expand Up @@ -480,16 +434,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 }} --config .ci/ct.yaml)
chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>')
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "chart_name=$chart_name" >> $GITHUB_OUTPUT
fi
- name: Create kind cluster
run: |
./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.25.11
Expand All @@ -499,12 +443,12 @@ jobs:
env:
KIND_VERSION: 0.20.0
SN_IMAGE: streamnative/sn-platform:2.10.4.3
if: steps.list-changed.outputs.changed == 'true'
if: ${{ needs.basic-tests.outputs.changed }} == 'true'


# Install the pulsar operator before testing the sn-platform
- name: Install the pulsar operator
if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform'
if: ${{ needs.basic-tests.outputs.changed }} == 'true' && ${{ needs.basic-tests.outputs.chart_name }} != 'charts/pulsar-operator'
run: |
helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com
helm -n sn-system install sn charts/pulsar-operator --create-namespace
Expand All @@ -517,7 +461,7 @@ jobs:
df -h
- name: Run chart-testing (install)
run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform
run: ct install --debug --config ct.yaml --print-config --charts ${{ needs.basic-tests.outputs.chart_name }}

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
Expand Down Expand Up @@ -555,16 +499,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 }} --config .ci/ct.yaml)
chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>')
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "chart_name=$chart_name" >> $GITHUB_OUTPUT
fi
- name: Create kind cluster
run: |
./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.26.6
Expand All @@ -574,12 +508,12 @@ jobs:
env:
KIND_VERSION: 0.20.0
SN_IMAGE: streamnative/sn-platform:2.10.4.3
if: steps.list-changed.outputs.changed == 'true'
if: ${{ needs.basic-tests.outputs.changed }} == 'true'


# Install the pulsar operator before testing the sn-platform
- name: Install the pulsar operator
if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform'
if: ${{ needs.basic-tests.outputs.changed }} == 'true' && ${{ needs.basic-tests.outputs.chart_name }} != 'charts/pulsar-operator'
run: |
helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com
helm -n sn-system install sn charts/pulsar-operator --create-namespace
Expand All @@ -592,7 +526,7 @@ jobs:
df -h
- name: Run chart-testing (install)
run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform
run: ct install --debug --config ct.yaml --print-config --charts ${{ needs.basic-tests.outputs.chart_name }}

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
Expand Down Expand Up @@ -630,16 +564,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 }} --config .ci/ct.yaml)
chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>')
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "chart_name=$chart_name" >> $GITHUB_OUTPUT
fi
- name: Create kind cluster
run: |
./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.27.3
Expand All @@ -649,12 +573,12 @@ jobs:
env:
KIND_VERSION: 0.20.0
SN_IMAGE: streamnative/sn-platform:2.10.4.3
if: steps.list-changed.outputs.changed == 'true'
if: ${{ needs.basic-tests.outputs.changed }} == 'true'


# Install the pulsar operator before testing the sn-platform
- name: Install the pulsar operator
if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform'
if: ${{ needs.basic-tests.outputs.changed }} == 'true' && ${{ needs.basic-tests.outputs.chart_name }} != 'charts/pulsar-operator'
run: |
helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com
helm -n sn-system install sn charts/pulsar-operator --create-namespace
Expand All @@ -667,7 +591,7 @@ jobs:
df -h
- name: Run chart-testing (install)
run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform
run: ct install --debug --config ct.yaml --print-config --charts ${{ needs.basic-tests.outputs.chart_name }}

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
Expand Down

0 comments on commit 8c67dc8

Please sign in to comment.