[pull] master from PhantomBot:master #1265
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: Java CI | |
on: | |
push: | |
branches: | |
- '*' | |
- '!edge' | |
paths: | |
- '**.java' | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
buildtest: | |
name: Test Build on ubuntu-latest with JDK 17 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Set up Ant | |
run: sudo apt-get install ant | |
- name: Build with Ant | |
run: ant -noinput -buildfile build.xml test | |
dockertest: | |
name: Docker test on ubuntu-latest with JDK 17 | |
runs-on: ubuntu-latest | |
needs: buildtest | |
timeout-minutes: 5 | |
services: | |
registry: | |
image: registry:2 | |
ports: | |
- 5000:5000 | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: linux/amd64 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
version: latest | |
driver-opts: network=host | |
- name: Build Docker (Save Cache) | |
if: github.ref_name == 'master' | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: ./Dockerfile | |
platforms: linux/amd64 | |
push: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
build-args: | | |
PROJECT_VERSION=0.0.0 | |
ANT_ARGS=-Dbuildtype=test -Dversion=0.0.0 | |
tags: localhost:5000/tester/phantombot:test | |
- name: Build Docker | |
if: github.ref_name != 'master' | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: ./Dockerfile | |
platforms: linux/amd64 | |
push: true | |
cache-from: type=gha,scope=master | |
build-args: | | |
PROJECT_VERSION=0.0.0 | |
ANT_ARGS=-Dbuildtype=test -Dversion=0.0.0 | |
tags: localhost:5000/tester/phantombot:test | |
- name: Test with Docker | |
run: docker run --rm --name phantombot localhost:5000/tester/phantombot:test launch-docker.sh --version |