|
| 1 | +name: Test get-supported-platforms action |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + |
| 6 | +jobs: |
| 7 | + test: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + steps: |
| 10 | + - name: Checkout repository |
| 11 | + uses: actions/checkout@v5 |
| 12 | + |
| 13 | + - name: Run get-supported-platforms OS JDK11 |
| 14 | + id: platform_os_jdk11 |
| 15 | + uses: ./get-supported-platforms |
| 16 | + with: |
| 17 | + dockerfile: ./get-supported-platforms/test-data/hazelcast-oss/Dockerfile |
| 18 | + jdk: 11 |
| 19 | + |
| 20 | + - name: Run get-supported-platforms EE JDK11 |
| 21 | + id: platform_ee_jdk11 |
| 22 | + uses: ./get-supported-platforms |
| 23 | + with: |
| 24 | + dockerfile: ./get-supported-platforms/test-data/hazelcast-enterprise/Dockerfile |
| 25 | + jdk: 11 |
| 26 | + |
| 27 | + - name: Run get-supported-platforms OS JDK11 |
| 28 | + id: platform_os_jdk21 |
| 29 | + uses: ./get-supported-platforms |
| 30 | + with: |
| 31 | + dockerfile: ./get-supported-platforms/test-data/hazelcast-oss/Dockerfile |
| 32 | + jdk: 21 |
| 33 | + |
| 34 | + - name: Run get-supported-platforms EE JDK11 |
| 35 | + id: platform_ee_jdk21 |
| 36 | + uses: ./get-supported-platforms |
| 37 | + with: |
| 38 | + dockerfile: ./get-supported-platforms/test-data/hazelcast-enterprise/Dockerfile |
| 39 | + jdk: 21 |
| 40 | + |
| 41 | + - name: Test |
| 42 | + run: | |
| 43 | + set -o errexit -o nounset -o pipefail ${RUNNER_DEBUG:+-x} |
| 44 | + source /dev/stdin <<< "$(curl --silent https://raw.githubusercontent.com/hazelcast/assert.sh/main/assert.sh)" |
| 45 | +
|
| 46 | + TESTS_RESULT=0 |
| 47 | + |
| 48 | + assert_equals() { |
| 49 | + local expected=$1 |
| 50 | + local actual=$2 |
| 51 | + local msg="Should be equal to ${expected}" |
| 52 | + assert_eq "$expected" "$actual" "$msg" && log_success "$msg" || TESTS_RESULT=$? |
| 53 | + } |
| 54 | + |
| 55 | + assert_equals "linux/arm64,linux/amd64,linux/s390x,linux/ppc64le" "${{ steps.platform_os_jdk11.outputs.platforms }}" |
| 56 | + assert_equals "linux/arm64,linux/amd64,linux/s390x,linux/ppc64le" "${{ steps.platform_ee_jdk11.outputs.platforms }}" |
| 57 | + assert_equals "linux/arm64,linux/amd64,linux/s390x" "${{ steps.platform_os_jdk21.outputs.platforms }}" |
| 58 | + assert_equals "linux/arm64,linux/amd64,linux/s390x,linux/ppc64le" "${{ steps.platform_ee_jdk21.outputs.platforms }}" |
| 59 | +
|
| 60 | + assert_eq 0 "$TESTS_RESULT" "All tests should pass" |
0 commit comments