mirror of
https://github.com/GTNewHorizons/GTNH-Actions-Workflows.git
synced 2025-07-03 10:51:35 +02:00
Support OpenGL in gradle tests (#36)
* Add Java 21 to pre-installed versions list * Update gradle wrapper validation action * Wrap test running in xvfb-run to provide a virtual framebuffer * Upload test reports too * Add xrandr
This commit is contained in:
parent
c65ccf0550
commit
87bfdc7ab1
22
.github/workflows/build-and-test.yml
vendored
22
.github/workflows/build-and-test.yml
vendored
@ -26,6 +26,10 @@ jobs:
|
|||||||
build-and-test:
|
build-and-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
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
|
- name: Checkout mod repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@ -38,13 +42,14 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Validate gradle wrapper checksum
|
- name: Validate gradle wrapper checksum
|
||||||
uses: gradle/wrapper-validation-action@v1
|
uses: gradle/wrapper-validation-action@v2
|
||||||
|
|
||||||
- name: Set up JDK 8 and 17
|
- name: Set up JDK versions
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
java-version: |
|
java-version: |
|
||||||
8
|
8
|
||||||
|
21
|
||||||
17
|
17
|
||||||
distribution: 'zulu'
|
distribution: 'zulu'
|
||||||
cache: gradle
|
cache: gradle
|
||||||
@ -61,13 +66,22 @@ jobs:
|
|||||||
- name: Attach compilation artifacts
|
- name: Attach compilation artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: build-libs
|
name: ${{ github.repository_id }}-build-libs
|
||||||
path: build/libs/
|
path: build/libs/
|
||||||
retention-days: 31
|
retention-days: 31
|
||||||
|
|
||||||
- name: Run post-build checks
|
- name: Run post-build checks
|
||||||
id: build_mod
|
id: build_mod
|
||||||
run: ./gradlew --build-cache --info --stacktrace build
|
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
|
||||||
|
|
||||||
- name: Attempt to make a PR fixing spotless errors
|
- name: Attempt to make a PR fixing spotless errors
|
||||||
if: ${{ failure() && steps.build_mod.conclusion == 'failure' && github.event_name == 'pull_request' && !github.event.pull_request.draft }}
|
if: ${{ failure() && steps.build_mod.conclusion == 'failure' && github.event_name == 'pull_request' && !github.event.pull_request.draft }}
|
||||||
|
5
.github/workflows/release-tags.yml
vendored
5
.github/workflows/release-tags.yml
vendored
@ -36,13 +36,14 @@ jobs:
|
|||||||
fetch-depth: 32
|
fetch-depth: 32
|
||||||
|
|
||||||
- name: Validate gradle wrapper checksum
|
- name: Validate gradle wrapper checksum
|
||||||
uses: gradle/wrapper-validation-action@v1
|
uses: gradle/wrapper-validation-action@v2
|
||||||
|
|
||||||
- name: Set up JDK 8 and 17
|
- name: Set up JDK versions
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
java-version: |
|
java-version: |
|
||||||
8
|
8
|
||||||
|
21
|
||||||
17
|
17
|
||||||
distribution: 'zulu'
|
distribution: 'zulu'
|
||||||
cache: gradle
|
cache: gradle
|
||||||
|
Loading…
x
Reference in New Issue
Block a user