2024-11-14 11:53:08 +01:00
|
|
|
name: Test
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
|
|
|
|
jobs:
|
2024-11-14 13:05:36 +01:00
|
|
|
Gradle-Test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Set up JDK
|
|
|
|
uses: actions/setup-java@v4
|
|
|
|
with:
|
|
|
|
java-version: '23'
|
|
|
|
check-latest: true
|
|
|
|
distribution: 'zulu'
|
|
|
|
|
|
|
|
- name: Setup Gradle
|
2024-11-14 12:45:43 +01:00
|
|
|
uses: gradle/actions/setup-gradle@v4
|
|
|
|
with:
|
|
|
|
add-job-summary: always
|
|
|
|
cache-cleanup: on-success
|
2024-11-14 11:53:08 +01:00
|
|
|
|
2024-11-14 13:05:36 +01:00
|
|
|
- name: Cache Gradle dependencies
|
|
|
|
uses: actions/cache@v4
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.gradle/caches
|
|
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-gradle-
|
|
|
|
|
|
|
|
- name: Test
|
|
|
|
env:
|
2024-11-14 13:54:12 +01:00
|
|
|
DISCORD_TEST_TOKEN: ${{ secrets.DISCORD_TOKEN }}
|
2024-11-14 13:05:36 +01:00
|
|
|
run: chmod +x gradlew; ./gradlew test
|
|
|
|
|
2024-11-15 11:46:58 +01:00
|
|
|
- name: Move Test Results
|
|
|
|
if: always()
|
|
|
|
run: |
|
|
|
|
mkdir test-results/;
|
|
|
|
[ -d lib/build/test-results/test/ ] && mv lib/build/test-results/test/*.xml test-results/;
|
|
|
|
[ -d wrapper/javacord/build/test-results/test/ ] && mv wrapper/javacord/build/test-results/test/*.xml test-results/;
|
|
|
|
|
|
|
|
- name: Upload Test Result
|
|
|
|
uses: christopherhx/gitea-upload-artifact@v4
|
2024-11-14 13:05:36 +01:00
|
|
|
if: always()
|
|
|
|
with:
|
2024-11-15 11:46:58 +01:00
|
|
|
name: test-results
|
|
|
|
path: test-results/
|