Add smoke test for SQL migrations and Paper startup (#654)

In the future we may want to use a matrix and test other platforms

related: #652, #653
This commit is contained in:
Jason Penilla authored and GitHub committed 2025-05-18 21:01:30 -07:00
1 parent d516736d21
commit b820439d46
4 files changed
+117 -2

No files matched your search

+68
View File
@@ -0,0 +1,68 @@
name: Smoke test
on:
workflow_run:
workflows: ["Build"] # This should match the exact name in build.yml
types:
- completed
jobs:
check:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13
env:
POSTGRES_USER: username
POSTGRES_PASSWORD: password
POSTGRES_DB: carbon
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mariadb:
image: mariadb:10.5
env:
MARIADB_USER: username
MARIADB_PASSWORD: password
MARIADB_ROOT_PASSWORD: rootpassword
MARIADB_DATABASE: carbon
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
strategy:
matrix:
java: [ 21 ]
fail-fast: true
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v4
- name: JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
# gradle build action can't handle project dir local caches
- uses: actions/cache@v4
with:
path: |
.gradle/loom-cache
key: ${{ runner.os }}-gradle-${{ hashFiles('**/libs.versions.*', '**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Smoke test (Paper, Postgres)
run: ./gradlew :carbonchat-paper:runServer -PsmokeTest=true -PsmokeTestMode=postgres
- name: Smoke test (Paper, MariaDB)
run: ./gradlew :carbonchat-paper:runServer -PsmokeTest=true -PsmokeTestMode=mariadb
- name: Smoke test (Paper, H2)
run: ./gradlew :carbonchat-paper:runServer -PsmokeTest=true -PsmokeTestMode=h2
- name: Smoke test (Paper, JSON)
run: ./gradlew :carbonchat-paper:runServer -PsmokeTest=true -PsmokeTestMode=json