Skip to content

Set the correct platform for images (#641) #820

Set the correct platform for images (#641)

Set the correct platform for images (#641) #820

# Copyright 2019, 2024, Oracle Corporation and/or its affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown at
# http://oss.oracle.com/licenses/upl.
# ---------------------------------------------------------------------------
# Coherence Operator GitHub Actions Backwards Compatibility Tests.
# ---------------------------------------------------------------------------
name: Backwards Compatibility Tests
on:
workflow_dispatch:
push:
branches-ignore:
- gh-pages
- 1.0.0
- 2.x
- 3.x
pull_request:
types:
- opened
- synchronize
- committed
branches-ignore:
- gh-pages
- 1.0.0
- 2.x
- 3.x
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compatibilityVersion:
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.11
- 3.2.10
- 3.2.9
- 3.2.7
- 3.2.6
include:
- compatibilityVersion: 3.3.2
coherence-image: "ghcr.io/oracle/coherence-ce:22.06.7"
compatibilitySelector: control-plane=coherence
k8s: kindest/node:v1.27.3@sha256:3966ac761ae0136263ffdb6cfd4db23ef8a83cba8a463690e98317add2c9ba72
- compatibilityVersion: 3.3.1
coherence-image: "ghcr.io/oracle/coherence-ce:22.06.7"
compatibilitySelector: control-plane=coherence
k8s: kindest/node:v1.27.3@sha256:3966ac761ae0136263ffdb6cfd4db23ef8a83cba8a463690e98317add2c9ba72
- compatibilityVersion: 3.3.0
coherence-image: "ghcr.io/oracle/coherence-ce:22.06.7"
compatibilitySelector: control-plane=coherence
k8s: kindest/node:v1.27.3@sha256:3966ac761ae0136263ffdb6cfd4db23ef8a83cba8a463690e98317add2c9ba72
- compatibilityVersion: 3.2.11
coherence-image: "ghcr.io/oracle/coherence-ce:22.06.7"
compatibilitySelector: control-plane=coherence
k8s: kindest/node:v1.26.6@sha256:6e2d8b28a5b601defe327b98bd1c2d1930b49e5d8c512e1895099e4504007adb
- compatibilityVersion: 3.2.10
coherence-image: "ghcr.io/oracle/coherence-ce:22.06.7"
compatibilitySelector: control-plane=coherence
k8s: kindest/node:v1.26.6@sha256:6e2d8b28a5b601defe327b98bd1c2d1930b49e5d8c512e1895099e4504007adb
- compatibilityVersion: 3.2.9
coherence-image: "ghcr.io/oracle/coherence-ce:22.06.7"
compatibilitySelector: control-plane=coherence
k8s: kindest/node:v1.24.12@sha256:1e12918b8bc3d4253bc08f640a231bb0d3b2c5a9b28aa3f2ca1aee93e1e8db16
- compatibilityVersion: 3.2.7
coherence-image: "ghcr.io/oracle/coherence-ce:22.06.7"
compatibilitySelector: control-plane=coherence
k8s: kindest/node:v1.24.12@sha256:1e12918b8bc3d4253bc08f640a231bb0d3b2c5a9b28aa3f2ca1aee93e1e8db16
- compatibilityVersion: 3.2.6
coherence-image: "ghcr.io/oracle/coherence-ce:22.06.7"
compatibilitySelector: control-plane=coherence
k8s: kindest/node:v1.24.12@sha256:1e12918b8bc3d4253bc08f640a231bb0d3b2c5a9b28aa3f2ca1aee93e1e8db16
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
# This step will free up disc space on the runner by removing
# lots of things that we do not need.
- name: disc
shell: bash
run: |
echo "Listing 100 largest packages"
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 100
df -h
echo "Removing large packages"
sudo apt-get remove -y '^dotnet-.*' || true
sudo apt-get remove -y '^llvm-.*' || true
sudo apt-get remove -y 'monodoc-http' || true
sudo apt-get remove -y 'php.*' || true
sudo apt-get remove -y azure-cli google-cloud-sdk hhvm google-chrome-stable firefox powershell mono-devel || true
sudo apt-get autoremove -y || true
sudo apt-get clean
df -h
echo "Removing large directories"
rm -rf /usr/share/dotnet/
sudo rm -rf /usr/local/lib/android
df -h
- name: Set up JDK
uses: oracle-actions/setup-java@v1
with:
website: oracle.com
release: 21
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21.x
- name: Cache Go Modules
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-mods-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-mods-
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Cache Tools
uses: actions/cache@v3
with:
path: build/tools
key: ${{ runner.os }}-build-tools-${{ hashFiles('**/Makefile') }}
restore-keys: ${{ runner.os }}-build-tools
- name: Edit DNS Resolve
shell: bash
run: |
sudo chown -R runner:runner /run/systemd/resolve/stub-resolv.conf
sudo echo nameserver 8.8.8.8 > /run/systemd/resolve/stub-resolv.conf
- name: Start KinD Cluster
# Start a KinD K8s cluster with single worker node
shell: bash
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
export KIND_IMAGE=${{ matrix.k8s }}
make kind
kubectl version
kubectl get nodes
docker pull gcr.io/distroless/java
docker pull gcr.io/distroless/java11-debian11
docker pull gcr.io/distroless/java17-debian11
docker pull ${{ matrix.coherence-image }}
- name: Build
shell: bash
run: make all
- name: Load Images to KinD
# Load the images just built to the KinD cluster
shell: bash
run: |
make kind-load
- name: Compatibility Tests
shell: bash
run: |
export COHERENCE_IMAGE=${{ matrix.coherence-image }}
export COMPATIBLE_VERSION=${{ matrix.compatibilityVersion }}
export COMPATIBLE_SELECTOR=${{ matrix.compatibilitySelector }}
make compatibility-test
- uses: actions/upload-artifact@v1
if: failure()
with:
name: test-output-${{ matrix.compatibilityVersion }}
path: build/_output/test-logs