mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-04 14:38:49 +00:00
Consolidate actions
This commit is contained in:
2 files changed
+67
-82
No files matched your search
@@ -7,10 +7,6 @@ on:
|
|||||||
release:
|
release:
|
||||||
types: [ published ]
|
types: [ published ]
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.ref }}-actions
|
|
||||||
cancel-in-progress: false
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
# Only run on PRs if the source branch is on someone else's repo
|
# Only run on PRs if the source branch is on someone else's repo
|
||||||
@@ -92,3 +88,70 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: Jars
|
name: Jars
|
||||||
path: build/libs/*.jar
|
path: build/libs/*.jar
|
||||||
|
smoketest:
|
||||||
|
needs: build
|
||||||
|
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.11
|
||||||
|
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-
|
||||||
|
# Don't count build time for smoke test timeout in case smoke test workflow runs first
|
||||||
|
- name: Build
|
||||||
|
run: ./gradlew build --stacktrace
|
||||||
|
- name: Smoke test (Paper, JSON)
|
||||||
|
run: ./gradlew :carbonchat-paper:runServer -PsmokeTest=true -PsmokeTestMode=json
|
||||||
|
timeout-minutes: 5
|
||||||
|
- name: Smoke test (Paper, H2)
|
||||||
|
run: ./gradlew :carbonchat-paper:runServer -PsmokeTest=true -PsmokeTestMode=h2
|
||||||
|
timeout-minutes: 5
|
||||||
|
- name: Smoke test (Paper, MariaDB)
|
||||||
|
run: ./gradlew :carbonchat-paper:runServer -PsmokeTest=true -PsmokeTestMode=mariadb
|
||||||
|
timeout-minutes: 5
|
||||||
|
- name: Smoke test (Paper, Postgres)
|
||||||
|
run: ./gradlew :carbonchat-paper:runServer -PsmokeTest=true -PsmokeTestMode=postgres
|
||||||
|
timeout-minutes: 5
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
name: Smoke test
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "**" ]
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.ref }}-actions
|
|
||||||
cancel-in-progress: false
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
check:
|
|
||||||
if: ${{ (github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name) && (github.event.name != 'push' || !startsWith(github.ref, 'refs/tags/') || contains(github.ref, '-beta.')) }}
|
|
||||||
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.11
|
|
||||||
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-
|
|
||||||
# Don't count build time for smoke test timeout in case smoke test workflow runs first
|
|
||||||
- name: Build
|
|
||||||
run: ./gradlew build --stacktrace
|
|
||||||
- name: Smoke test (Paper, JSON)
|
|
||||||
run: ./gradlew :carbonchat-paper:runServer -PsmokeTest=true -PsmokeTestMode=json
|
|
||||||
timeout-minutes: 5
|
|
||||||
- name: Smoke test (Paper, H2)
|
|
||||||
run: ./gradlew :carbonchat-paper:runServer -PsmokeTest=true -PsmokeTestMode=h2
|
|
||||||
timeout-minutes: 5
|
|
||||||
- name: Smoke test (Paper, MariaDB)
|
|
||||||
run: ./gradlew :carbonchat-paper:runServer -PsmokeTest=true -PsmokeTestMode=mariadb
|
|
||||||
timeout-minutes: 5
|
|
||||||
- name: Smoke test (Paper, Postgres)
|
|
||||||
run: ./gradlew :carbonchat-paper:runServer -PsmokeTest=true -PsmokeTestMode=postgres
|
|
||||||
timeout-minutes: 5
|
|
||||||
Reference in new issue
Block a user