Added new workflows #682
Workflow file for this run
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: | |
branches: | |
- "**" | |
pull_request: | |
branches: | |
- "**" | |
- "!master" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
mod_loader: [fabric, forge, neoforge] | |
script: [client, server] | |
name: Run ${{ matrix.mod_loader }} ${{ matrix.script }} | |
timeout-minutes: 15 | |
steps: | |
- name: "Checkout repository" | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: "Check if the mod loader is supported" | |
id: check-mod-loader | |
run: | | |
if [ -d ${{ matrix.mod_loader }} ]; then | |
echo "Mod loader is supported" | |
echo "is_mod_loader_supported=true" >> $GITHUB_OUTPUT | |
else | |
echo "Mod loader is not supported" | |
echo "is_mod_loader_supported=false" >> $GITHUB_OUTPUT | |
fi | |
- name: "Set up JDK" | |
if: steps.check-mod-loader.outputs.is_mod_loader_supported == 'true' | |
uses: actions/[email protected] | |
with: | |
java-version: 17 | |
distribution: temurin | |
- name: "Setup Gradle and run build" | |
if: steps.check-mod-loader.outputs.is_mod_loader_supported == 'true' | |
uses: gradle/[email protected] | |
with: | |
cache-read-only: false | |
gradle-version: wrapper | |
arguments: ${{ matrix.mod_loader }}:build | |
- name: "Accept eula" | |
if: steps.check-mod-loader.outputs.is_mod_loader_supported == 'true' | |
run: mkdir -p ${{ matrix.mod_loader }}/run && echo "eula=true" > ${{ matrix.mod_loader }}/run/eula.txt | |
- name: Run ${{ matrix.mod_loader }} ${{ matrix.script }} | |
if: steps.check-mod-loader.outputs.is_mod_loader_supported == 'true' | |
uses: modmuss50/xvfb-action@v1 | |
with: | |
run: ./.github/scripts/run-${{ matrix.script }}.sh ${{ matrix.mod_loader }} | |
shell: bash |