2022-08-06 02:45:18 +00:00
|
|
|
name: Verify PR
|
2022-08-06 02:42:58 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
types: [assigned, opened, synchronize, labeled]
|
|
|
|
paths-ignore:
|
|
|
|
- "*.md"
|
|
|
|
- "docs/**"
|
|
|
|
- "examples/**"
|
2023-05-28 17:55:47 +00:00
|
|
|
- "docker-compose*.yml"
|
|
|
|
- "mkdocs.yml"
|
2022-08-06 02:42:58 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
variant:
|
2023-11-03 22:33:10 +00:00
|
|
|
- java21
|
2022-08-06 02:42:58 +00:00
|
|
|
- java17
|
|
|
|
- java17-alpine
|
2022-09-04 23:14:33 +00:00
|
|
|
- java8-multiarch
|
2022-08-06 02:42:58 +00:00
|
|
|
include:
|
2023-11-03 22:33:10 +00:00
|
|
|
# JAVA 21:
|
|
|
|
- variant: java21
|
|
|
|
baseImage: eclipse-temurin:21-jre
|
2023-05-31 18:14:05 +00:00
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
mcVersion: 1.19.4
|
2022-08-06 02:42:58 +00:00
|
|
|
# JAVA 17:
|
|
|
|
- variant: java17
|
|
|
|
# jammy doesn't work until minecraft updates to https://github.com/netty/netty/issues/12343
|
|
|
|
baseImage: eclipse-temurin:17-jre-focal
|
2022-09-04 23:14:33 +00:00
|
|
|
platforms: linux/amd64
|
2023-05-31 18:14:05 +00:00
|
|
|
mcVersion: 1.19.4
|
2022-08-06 02:42:58 +00:00
|
|
|
- variant: java17-alpine
|
|
|
|
baseImage: eclipse-temurin:17-jre-alpine
|
|
|
|
platforms: linux/amd64
|
2023-05-31 18:14:05 +00:00
|
|
|
mcVersion: 1.19.4
|
2022-09-04 23:14:33 +00:00
|
|
|
- variant: java8-multiarch
|
|
|
|
baseImage: eclipse-temurin:8u312-b07-jre-focal
|
|
|
|
platforms: linux/amd64
|
|
|
|
mcVersion: 1.12.2
|
2022-08-06 02:42:58 +00:00
|
|
|
env:
|
|
|
|
IMAGE_TO_TEST: ${{ github.repository_owner }}/minecraft-server:test-${{ matrix.variant }}-${{ github.run_id }}
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-10-24 13:42:01 +00:00
|
|
|
uses: actions/checkout@v4.1.1
|
2022-08-06 02:42:58 +00:00
|
|
|
with:
|
|
|
|
# for build-files step
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Setup Docker Buildx
|
2023-09-23 23:44:45 +00:00
|
|
|
uses: docker/setup-buildx-action@v3.0.0
|
2022-08-06 02:42:58 +00:00
|
|
|
|
2023-05-31 18:14:05 +00:00
|
|
|
- name: Confirm multi-arch build
|
2023-09-23 23:44:45 +00:00
|
|
|
uses: docker/build-push-action@v5.0.0
|
2023-05-31 18:14:05 +00:00
|
|
|
with:
|
|
|
|
platforms: ${{ matrix.platforms }}
|
|
|
|
# ensure latest base image is used
|
|
|
|
pull: true
|
|
|
|
build-args: |
|
|
|
|
BASE_IMAGE=${{ matrix.baseImage }}
|
|
|
|
cache-from: type=gha,scope=${{ matrix.variant }}
|
|
|
|
|
2022-08-06 02:42:58 +00:00
|
|
|
- name: Build for test
|
2023-09-23 23:44:45 +00:00
|
|
|
uses: docker/build-push-action@v5.0.0
|
2022-08-06 02:42:58 +00:00
|
|
|
with:
|
2023-05-31 18:14:05 +00:00
|
|
|
# Only build single platform since loading multi-arch image into daemon fails with
|
|
|
|
# "docker exporter does not currently support exporting manifest lists"
|
2022-08-06 02:42:58 +00:00
|
|
|
platforms: linux/amd64
|
|
|
|
tags: ${{ env.IMAGE_TO_TEST }}
|
|
|
|
# ensure latest base image is used
|
|
|
|
pull: true
|
|
|
|
# load into daemon for test usage in next step
|
|
|
|
load: true
|
|
|
|
push: false
|
|
|
|
build-args: |
|
|
|
|
BASE_IMAGE=${{ matrix.baseImage }}
|
|
|
|
cache-from: type=gha,scope=${{ matrix.variant }}
|
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
env:
|
|
|
|
MINECRAFT_VERSION: ${{ matrix.mcVersion }}
|
|
|
|
VARIANT: ${{ matrix.variant }}
|
2023-08-06 20:12:29 +00:00
|
|
|
CF_API_KEY: ${{ secrets.CF_API_KEY }}
|
2022-09-10 17:58:32 +00:00
|
|
|
DEBUG: ${{ runner.debug }}
|
2022-08-06 02:42:58 +00:00
|
|
|
run: |
|
|
|
|
tests/test.sh
|