Skip to content

Commit

Permalink
Update build-and-test.yml
Browse files Browse the repository at this point in the history
Change it to retain artifacts for 90 days, also remove the server part of build and test since it's mostly a client mod
Also don't skip this build, we want to generate a new artifact
  • Loading branch information
Roadhog360 authored Nov 1, 2024
1 parent 800d62d commit 5ed2c11
Showing 1 changed file with 75 additions and 2 deletions.
77 changes: 75 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,81 @@ on:
branches: [ master, main ]
push:
branches: [ master, main ]
workflow_call:
inputs:
timeout:
description: 'Timeout for runServer (seconds)'
required: false
default: 90
type: number
workspace:
description: 'setupCIWorkspace/setupDecompWorkspace'
required: false
default: "setupCIWorkspace"
type: string
client-only:
description: 'Do not execute runServer'
required: false
default: false
type: boolean

jobs:
build-and-test:
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/build-and-test.yml@master
secrets: inherit
runs-on: ubuntu-latest
steps:
- name: Install Ubuntu dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y mesa-utils xvfb x11-xserver-utils
- name: Checkout mod repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout workflows repo
uses: actions/checkout@v4
with:
repository: GTNewHorizons/GTNH-Actions-Workflows
path: .gtnh-workflows
fetch-depth: 0

- name: Validate gradle wrapper checksum
uses: gradle/wrapper-validation-action@v2

- name: Set up JDK versions
uses: actions/setup-java@v4
with:
java-version: |
8
21
17
distribution: 'zulu'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Setup the workspace
run: ./gradlew --build-cache --info --stacktrace ${{ inputs.workspace }}

- name: Compile the mod
run: ./gradlew --build-cache --info --stacktrace assemble

- name: Attach compilation artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ github.repository_id }}-build-libs
path: build/libs/
retention-days: 90

- name: Run post-build checks
id: build_mod
run: xvfb-run --server-args="-screen 0 1366x768x24" ./gradlew --build-cache --info --stacktrace build

- name: Attach gradle reports
if: failure() && steps.build_mod.conclusion == 'failure'
uses: actions/upload-artifact@v4
continue-on-error: true
with:
name: ${{ github.repository_id }}-reports
path: build/reports/
retention-days: 31

0 comments on commit 5ed2c11

Please sign in to comment.