This repository has been archived by the owner on May 16, 2024. It is now read-only.
chore(deps): update dependency net.kyori:adventure-text-minimessage t… #151
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: Build | |
on: | |
push: | |
jobs: | |
build: | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout project sources | |
uses: actions/checkout@v4.1.4 | |
- name: Setup java | |
uses: actions/setup-java@v4.2.1 | |
with: | |
distribution: temurin | |
java-version: "21" | |
check-latest: true | |
- name: Setup gradle | |
uses: gradle/actions/setup-gradle@v3.3.2 | |
with: | |
cache-read-only: false | |
- name: Setup build cache | |
uses: actions/cache@v4.0.2 | |
with: | |
path: "**/build/" | |
key: classes-${{ github.ref_name }}-${{ github.sha }} | |
restore-keys: | | |
classes-${{ github.ref_name }}- | |
classes-main-${{ github.event.pull_request.base.sha }} | |
- name: Compile project | |
run: ./gradlew --no-daemon --warning-mode=all --info --configuration-cache --build-cache classes testClasses integrationTestsClasses assemble | |
- name: Upload server jar as an artifact | |
uses: actions/upload-artifact@v4.3.3 | |
with: | |
name: jar-${{ github.sha }} | |
path: | | |
Dockerfile | |
runner/build/libs/ | |
build-container-review: | |
if: "!contains(github.ref, 'main')" | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download server jar artifact | |
uses: actions/download-artifact@v4.1.7 | |
with: | |
name: jar-${{ github.sha }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3.3.0 | |
- name: Set branch variable | |
shell: bash | |
run: echo "BRANCH=$(echo -n "${GITHUB_REF_NAME}" | sed 's~\/~\-~g')" >> $GITHUB_ENV | |
- name: Set tag variable | |
shell: bash | |
run: echo "TAG_NAME=$(date +'%s')" >> $GITHUB_ENV | |
- name: Login to container registry | |
uses: docker/login-action@v3.1.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v5.3.0 | |
with: | |
context: . | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
platforms: linux/arm64,linux/amd64 | |
provenance: false | |
push: true | |
tags: ghcr.io/${{ github.repository }}:${{ env.BRANCH }}-${{ env.TAG_NAME }} | |
unit-tests: | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout project sources | |
uses: actions/checkout@v4.1.4 | |
- name: Setup java | |
uses: actions/setup-java@v4.2.1 | |
with: | |
distribution: temurin | |
java-version: "21" | |
check-latest: true | |
- name: Setup gradle | |
uses: gradle/actions/setup-gradle@v3.3.2 | |
with: | |
cache-read-only: false | |
- name: Setup build cache | |
uses: actions/cache@v4.0.2 | |
with: | |
path: "**/build/" | |
key: classes-${{ github.ref_name }}-${{ github.sha }} | |
restore-keys: | | |
classes-${{ github.ref_name }}- | |
classes-main-${{ github.event.pull_request.base.sha }} | |
- name: Run unit tests | |
run: ./gradlew --no-daemon --warning-mode=all --info --configuration-cache --build-cache testClasses test | |
- name: Upload unit tests result as an artifact | |
uses: actions/upload-artifact@v4.3.3 | |
with: | |
name: tests_unit-${{ github.sha }} | |
path: | | |
**/build/jacoco/test.exec | |
**/build/test-results/test/*.xml | |
integration-tests: | |
needs: build | |
services: | |
mongo: | |
image: mongo:7.0.9 | |
ports: | |
- 27017:27017 | |
env: | |
MONGO_INITDB_ROOT_USERNAME: minigames | |
MONGO_INITDB_ROOT_PASSWORD: example | |
env: | |
DAYLIFECRAFT_SETTINGS_MONGODB_HOSTNAME: "127.0.0.1" | |
DAYLIFECRAFT_SETTINGS_MONGODB_PASSWORD: example | |
DEBIAN_FRONTEND: noninteractive | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout project sources | |
uses: actions/checkout@v4.1.4 | |
- name: Setup java | |
uses: actions/setup-java@v4.2.1 | |
with: | |
distribution: temurin | |
java-version: "21" | |
check-latest: true | |
- name: Setup gradle | |
uses: gradle/actions/setup-gradle@v3.3.2 | |
with: | |
cache-read-only: false | |
- name: Setup build cache | |
uses: actions/cache@v4.0.2 | |
with: | |
path: "**/build/" | |
key: classes-${{ github.ref_name }}-${{ github.sha }} | |
restore-keys: | | |
classes-${{ github.ref_name }}- | |
classes-main-${{ github.event.pull_request.base.sha }} | |
- name: Run integration tests | |
run: ./gradlew --no-daemon --warning-mode=all --info --configuration-cache --build-cache integrationTestsClasses integration-tests | |
- name: Upload integration tests result as an artifact | |
uses: actions/upload-artifact@v4.3.3 | |
with: | |
name: tests_integration-${{ github.sha }} | |
path: | | |
**/build/jacoco/integration-tests.exec | |
**/build/test-results/integration-tests/*.xml | |
detekt: | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout project sources | |
uses: actions/checkout@v4.1.4 | |
- name: Setup java | |
uses: actions/setup-java@v4.2.1 | |
with: | |
distribution: temurin | |
java-version: "21" | |
check-latest: true | |
- name: Setup gradle | |
uses: gradle/actions/setup-gradle@v3.3.2 | |
with: | |
cache-read-only: false | |
- name: Setup build cache | |
uses: actions/cache@v4.0.2 | |
with: | |
path: "**/build/" | |
key: classes-${{ github.ref_name }}-${{ github.sha }} | |
restore-keys: | | |
classes-${{ github.ref_name }}- | |
classes-main-${{ github.event.pull_request.base.sha }} | |
- name: Run detekt | |
run: ./gradlew --no-daemon --warning-mode=all --info --configuration-cache --build-cache detekt | |
- name: Upload detekt report as an artifact | |
uses: actions/upload-artifact@v4.3.3 | |
with: | |
name: detekt-${{ github.sha }} | |
path: "**/build/reports/detekt/detekt.xml" | |
ktlint: | |
if: "!contains(github.ref, 'main')" | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
KTLINT_VERSION: "1.2.1" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout project sources | |
uses: actions/checkout@v4.1.4 | |
- name: Setup java | |
uses: actions/setup-java@v4.2.1 | |
with: | |
distribution: temurin | |
java-version: "21" | |
check-latest: true | |
- name: Setup ktlint cache | |
uses: actions/cache@v4.0.2 | |
with: | |
path: "/usr/local/bin/ktlint-${{ env.KTLINT_VERSION }}" | |
key: ktlint-${{ env.KTLINT_VERSION }} | |
- name: Download ktlint | |
run: | | |
[[ -e /usr/local/bin/ktlint-${{ env.KTLINT_VERSION }} ]] || curl -L https://github.com/pinterest/ktlint/releases/download/${{ env.KTLINT_VERSION }}/ktlint -o /usr/local/bin/ktlint-${{ env.KTLINT_VERSION }} && chmod +x /usr/local/bin/ktlint-${{ env.KTLINT_VERSION }} | |
- name: Run ktlint | |
run: ktlint-${{ env.KTLINT_VERSION }} | |
jacoco: | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
needs: | |
- unit-tests | |
- integration-tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout project sources | |
uses: actions/checkout@v4.1.4 | |
- name: Setup java | |
uses: actions/setup-java@v4.2.1 | |
with: | |
distribution: temurin | |
java-version: "21" | |
check-latest: true | |
- name: Setup gradle | |
uses: gradle/actions/setup-gradle@v3.3.2 | |
with: | |
cache-read-only: false | |
- name: Setup build cache | |
uses: actions/cache@v4.0.2 | |
with: | |
path: "**/build/" | |
key: classes-${{ github.ref_name }}-${{ github.sha }} | |
restore-keys: | | |
classes-${{ github.ref_name }}- | |
classes-main-${{ github.event.pull_request.base.sha }} | |
- name: Download unit tests artifact | |
uses: actions/download-artifact@v4.1.7 | |
with: | |
name: tests_unit-${{ github.sha }} | |
- name: Download integration tests artifact | |
uses: actions/download-artifact@v4.1.7 | |
with: | |
name: tests_integration-${{ github.sha }} | |
- name: Run jacoco | |
run: ./gradlew --no-daemon --warning-mode=all --info --configuration-cache --build-cache jacocoTestReport | |
- name: Upload jacoco coverage report as an artifact | |
uses: actions/upload-artifact@v4.3.3 | |
with: | |
name: jacoco-coverage-${{ github.sha }} | |
path: "**/build/reports/jacoco/test/jacocoTestReport.xml" | |
sonar: | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
needs: | |
- unit-tests | |
- integration-tests | |
- jacoco | |
- detekt | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout project sources | |
uses: actions/checkout@v4.1.4 | |
with: | |
fetch-depth: 0 | |
- name: Setup java | |
uses: actions/setup-java@v4.2.1 | |
with: | |
distribution: temurin | |
java-version: "21" | |
check-latest: true | |
- name: Setup gradle | |
uses: gradle/actions/setup-gradle@v3.3.2 | |
with: | |
cache-read-only: false | |
- name: Setup build cache | |
uses: actions/cache@v4.0.2 | |
with: | |
path: "**/build/" | |
key: classes-${{ github.ref_name }}-${{ github.sha }} | |
restore-keys: | | |
classes-${{ github.ref_name }}- | |
classes-main-${{ github.event.pull_request.base.sha }} | |
- name: Download unit tests artifact | |
uses: actions/download-artifact@v4.1.7 | |
with: | |
name: tests_unit-${{ github.sha }} | |
- name: Download integration tests artifact | |
uses: actions/download-artifact@v4.1.7 | |
with: | |
name: tests_integration-${{ github.sha }} | |
- name: Download jacoco coverage report artifact | |
uses: actions/download-artifact@v4.1.7 | |
with: | |
name: jacoco-coverage-${{ github.sha }} | |
- name: Download detekt report artifact | |
uses: actions/download-artifact@v4.1.7 | |
with: | |
name: detekt-${{ github.sha }} | |
- name: Run sonar scan | |
run: ./gradlew --no-daemon --warning-mode=all --info --configuration-cache --build-cache testClasses integrationTestsClasses sonar |