Skip to content

cicd: perform chart tests on current code base #6

cicd: perform chart tests on current code base

cicd: perform chart tests on current code base #6

################################################################################
# Copyright (c) 2021,2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
################################################################################
name: Package - Maven Project
on:
workflow_call:
workflow_dispatch:
pull_request:
branches:
- main
jobs:
check-apps:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Kubernetes KinD Cluster
uses: container-tools/kind-action@v2
with:
version: v0.20.0
node_image: ${{ github.event.inputs.node_image || 'kindest/node:v1.27.3' }}
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: ${{ github.event.inputs.helm_version || 'latest' }}
- uses: actions/setup-python@v5
with:
python-version: '3.9'
check-latest: true
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.1
- name: Maven Build And Test
run: mvn clean package -B
- name: Docker Build Pool
uses: docker/build-push-action@v5
with:
context: .
push: true
file: docker/bpdm-app/Dockerfile
tags: kind-registry:5000/bpdm-pool:test
build-args: 'JAR_PATH=./bpdm-pool/target/bpdm-pool.jar'
- name: Docker Build Gate
uses: docker/build-push-action@v5
with:
context: .
push: true
file: docker/bpdm-app/Dockerfile
tags: kind-registry:5000/bpdm-gate:test
build-args: 'JAR_PATH=./bpdm-gate/target/bpdm-gate.jar'
- name: Docker Build Orchestrator
uses: docker/build-push-action@v5
with:
context: .
push: true
file: docker/bpdm-app/Dockerfile
tags: kind-registry:5000/bpdm-orchestrator:test
build-args: 'JAR_PATH=./bpdm-orchestrator/target/bpdm-orchestrator.jar'
- name: Docker Build Cleaning Dummy
uses: docker/build-push-action@v5
with:
context: .
push: true
file: docker/bpdm-app/Dockerfile
tags: kind-registry:5000/bpdm-cleaning-service-dummy:test
build-args: 'JAR_PATH=./bpdm-cleaning-service-dummy/target/bpdm-cleaning-service-dummy.jar'
- name: Create Test Values
run: |
mdkir charts/ci
cat <<EOF > charts/ci/test-values.yml
bpdm-gate:
image:
registry: kind-registry:5000
repository: bpdm-gate
tag: test
bpdm-pool:
image:
registry: kind-registry:5000
repository: bpdm-pool
tag: test
bpdm-orchestrator:
image:
registry: kind-registry:5000
repository: bpdm-orchestrator
tag: test
bpdm-cleaning-service-dummy:
image:
registry: kind-registry:5000
repository: bpdm-cleaning-service-dummy
tag: test
EOF
echo "cat charts/ci/test-values.yml"
cat charts/ci/test-values.yml
- name: Create Chart-Testing Config
run: |
cat <<EOF > .chart-testing-config.yaml
validate-maintainers: false
chart-repos:
- bitnami=https://charts.bitnami.com/bitnami
helm-extra-args: --timeout 600s
EOF
echo "cat .chart-testing-config.yaml"
cat .chart-testing-config.yaml
- name: Run chart-testing (install)
run: ct install --charts charts/bpdm --config .chart-testing-config.yaml