OPSEXP-2737 Test on KinD #185
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build, Run and Test Docker Image | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
build-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Setup nexus authentication | |
run: | | |
echo "machine nexus.alfresco.com" >> ~/.netrc | |
echo "login ${{ secrets.NEXUS_USERNAME }}" >> ~/.netrc | |
echo "password ${{ secrets.NEXUS_PASSWORD }}" >> ~/.netrc | |
- name: Fetch artifacts from nexus | |
run: ./scripts/fetch-artifact.sh | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@5927c834f5b4fdf503fca6f4c7eccda82949e1ee # v3.1.0 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@2ad185228a349d19414702819e06df9fa4314287 # v3.4.0 | |
- name: Login to Quay.io | |
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_PASSWORD }} | |
- name: Bake Docker images | |
uses: docker/bake-action@eac74531aa56a9266bfedfe5edb6b851ce2cca2b # v5.4.0 | |
with: | |
set: | | |
*.cache-from=type=gha | |
*.cache-to=type=gha,mode=max | |
- name: Show all built images | |
run: docker images | |
- name: Docker save all baked images whose name include `alfresco` | |
run: | | |
docker save -o /tmp/alfresco-docker-images.tar $(docker images --format "{{.Repository}}:{{.Tag}}" | grep alfresco) | |
- name: Upload images as artifact | |
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 | |
with: | |
name: docker-images | |
path: /tmp/alfresco-docker-images.tar | |
retention-days: 1 | |
compression-level: 0 | |
compose-test: | |
name: compose-test ${{ matrix.docker-compose-file }} | |
needs: build-test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
docker-compose-file: [docker-compose.yml, docker-compose-components.yml] | |
steps: | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@2ad185228a349d19414702819e06df9fa4314287 # v3.4.0 | |
- name: Download artifacts | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
path: /tmp | |
name: docker-images | |
- name: Load Docker images | |
run: | | |
ls -1 /tmp/*.tar | xargs --no-run-if-empty -L 1 docker load -i | |
docker image ls -a | |
- name: Verify docker-compose | |
uses: Alfresco/alfresco-build-tools/.github/actions/dbp-charts/[email protected] | |
timeout-minutes: 10 | |
with: | |
compose_pull: false | |
compose_file_path: docker-compose/${{ matrix.docker-compose-file }} | |
quay_username: ${{ secrets.QUAY_USERNAME }} | |
quay_password: ${{ secrets.QUAY_PASSWORD }} | |
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected] | |
helm-test: | |
name: helm test | |
needs: build-test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
path: /tmp | |
name: docker-images | |
- name: Setup cluster | |
uses: Alfresco/alfresco-build-tools/.github/actions/[email protected] | |
with: | |
ingress-nginx-ref: controller-v1.8.2 | |
metrics: "true" | |
- name: Load Docker images | |
run: | | |
kind get clusters | |
ls -1 /tmp/*.tar | xargs --no-run-if-empty -L 1 kind load image-archive -n chart-testing | |
- name: Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 | |
with: | |
version: "3.14.3" | |
- name: Login to Quay.io | |
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_PASSWORD }} | |
- name: Create registries auth secret | |
run: >- | |
kubectl create secret generic regcred | |
--from-file=.dockerconfigjson=$HOME/.docker/config.json | |
--type=kubernetes.io/dockerconfigjson | |
- name: Fetch upstream values for tests | |
working-directory: test/helm | |
run: >- | |
curl -L | |
https://raw.githubusercontent.com/Alfresco/acs-deployment/c1096488a9dd2bef4fe20f9677a14afba4fc8932/test/enterprise-integration-test-values.yaml | |
-o enterprise-integration-test-values.yaml | |
- name: Helm install | |
run: | | |
helm repo add alfresco https://kubernetes-charts.alfresco.com/stable | |
helm repo update | |
helm install acs alfresco/alfresco-content-services \ | |
--set global.search.sharedSecret="$(openssl rand -hex 24)" \ | |
--set global.known_urls=http://localhost \ | |
--set global.alfrescoRegistryPullSecrets=regcred \ | |
--values test/helm/enterprise-integration-test-values.yaml \ | |
--values test/helm/test-overrides.yaml | |
- name: Spit cluster status after install | |
if: always() | |
run: | | |
helm ls --all-namespaces --all | |
helm status acs --show-resources | |
kubectl describe pod | |
- name: Run helm test | |
id: helm_test | |
run: helm test acs |