|
1 | 1 | --- |
2 | 2 | # |
3 | | -# Copyright (c) 2022, 2023 Contributors to the Eclipse Foundation |
| 3 | +# Copyright (c) 2022,2024 Contributors to the Eclipse Foundation |
4 | 4 | # |
5 | 5 | # See the NOTICE file(s) distributed with this work for additional |
6 | 6 | # information regarding copyright ownership. |
@@ -56,23 +56,38 @@ jobs: |
56 | 56 | lint-test: |
57 | 57 | runs-on: ubuntu-latest |
58 | 58 | steps: |
| 59 | + # get the code |
59 | 60 | - name: Checkout |
60 | 61 | uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
61 | 62 | with: |
62 | 63 | fetch-depth: 0 |
63 | 64 |
|
| 65 | + # Set-Up Helm |
64 | 66 | - name: Set up Helm |
65 | 67 | uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5 |
66 | 68 | with: |
67 | 69 | version: v3.10.3 |
68 | 70 |
|
| 71 | + # Set-Up Java |
| 72 | + - name: Setup JDK 17 |
| 73 | + uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 |
| 74 | + with: |
| 75 | + java-version: '17' |
| 76 | + distribution: 'temurin' |
| 77 | + cache: 'maven' |
| 78 | + |
| 79 | + # Set-Up Python |
69 | 80 | - uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1 |
70 | 81 | with: |
71 | 82 | python-version: 3.9 |
72 | 83 |
|
| 84 | + # Set-Up CT |
73 | 85 | - name: Set up chart-testing |
74 | 86 | uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1 |
75 | 87 |
|
| 88 | + - name: Run chart-testing (lint) |
| 89 | + run: ct lint --target-branch ${{ github.base_ref || github.ref_name }} --config charts/config/chart-testing-config.yaml |
| 90 | + |
76 | 91 | - name: Run chart-testing (list-changed) |
77 | 92 | id: list-changed |
78 | 93 | run: | |
|
81 | 96 | echo "CHART_CHANGED=true" >> $GITHUB_ENV |
82 | 97 | fi |
83 | 98 |
|
84 | | - # run chart linting |
85 | | - - name: Run chart-testing (lint) |
86 | | - run: ct lint --target-branch ${{ github.base_ref || github.ref_name }} --config charts/config/chart-testing-config.yaml |
| 99 | + # Preparing a kind cluster to install and test charts on |
| 100 | + - name: Create kind cluster |
| 101 | + uses: container-tools/kind-action@0fc957b58d9a5bc9ca57a1b419324a2074c7653b # v2.0.3 |
| 102 | + with: |
| 103 | + # upgrade version, default (v0.17.0) uses node image v1.21.1 and doesn't work with more recent node image versions |
| 104 | + version: v0.20.0 |
| 105 | + # default value for event_name != workflow_dispatch |
| 106 | + node_image: ${{ github.event.inputs.node_image || 'kindest/node:v1.27.3' }} |
| 107 | + if: github.event_name != 'pull_request' || env.CHART_CHANGED == 'true' |
| 108 | + |
| 109 | + - name: Build Java/Docker via Maven |
| 110 | + run: | |
| 111 | + ./mvnw -s settings.xml deploy -Drepo=kind-registry:5000/tractusx/ -Dmaven.deploy.skip -DskipTests -Pwith-docker-image |
| 112 | + if: github.event_name != 'pull_request' || env.CHART_CHANGED == 'true' |
| 113 | + |
| 114 | + # install the chart to the kind cluster and run helm test |
| 115 | + # define charts to test with the --charts parameter |
| 116 | + - name: Run chart-testing (install) |
| 117 | + run: | |
| 118 | + helm repo add bitnami https://charts.bitnami.com/bitnami |
| 119 | + helm repo add hashicorp https://helm.releases.hashicorp.com |
| 120 | + ct install --charts charts/agent-plane,charts/agent-plane-azure-vault --config charts/config/chart-testing-config.yaml --helm-extra-set-args="--set=imageRegistry=kind-registry:5000/" |
| 121 | + if: github.event_name != 'pull_request' || env.CHART_CHANGED == 'true' |
| 122 | + |
| 123 | + # Upgrade the released chart version with the locally available chart |
| 124 | + # default value for event_name != workflow_dispatch |
| 125 | + - name: Run helm upgrade on agent plane |
| 126 | + run: | |
| 127 | + helm repo add tractusx-dev https://eclipse-tractusx.github.io/charts/dev |
| 128 | + helm install agent tractusx-dev/agent-plane --version ${{ github.event.inputs.upgrade_from }} --set=image.registry=kind-registry:5000/ |
| 129 | + helm dependency update charts/agent-plane |
| 130 | + helm upgrade agent charts/agent-plamne |
| 131 | + if: (github.event_name != 'pull_request' || env.CHART_CHANGED == 'true') && github.event.inputs.upgrade_from != '' && github.event.inputs.upgrade_from != 'x.x.x' |
| 132 | + |
| 133 | + # Upgrade the released chart version with the locally available chart |
| 134 | + # default value for event_name != workflow_dispatch |
| 135 | + - name: Run helm upgrade on agent plane azure vault |
| 136 | + run: | |
| 137 | + helm repo add tractusx-dev https://eclipse-tractusx.github.io/charts/dev |
| 138 | + helm install agent-azure tractusx-dev/agent-plane-azure-vault --version ${{ github.event.inputs.upgrade_from }} --set=imageRegistry=kind-registry:5000/ |
| 139 | + helm dependency update charts/agent-plane-azure-vault |
| 140 | + helm upgrade agent-azure charts/agent-plane-azure-vault |
| 141 | + if: (github.event_name != 'pull_request' || env.CHART_CHANGED == 'true') && github.event.inputs.upgrade_from != '' && github.event.inputs.upgrade_from != 'x.x.x' |
| 142 | + |
0 commit comments