42 lines
1.2 KiB
YAML
42 lines
1.2 KiB
YAML
name: Run Tests on Pull Request
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
jobs:
|
|
run-tests:
|
|
runs-on: java26
|
|
|
|
steps:
|
|
- name: Checkout Code
|
|
run: |
|
|
SERVER_DOMAIN=$(echo "${{ github.server_url }}" | sed 's/https:\/\///')
|
|
rm -rf "$GITHUB_WORKSPACE"/*
|
|
git clone "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@${SERVER_DOMAIN}/${{ github.repository }}.git" "$GITHUB_WORKSPACE"
|
|
cd "$GITHUB_WORKSPACE"
|
|
git checkout ${{ github.sha }}
|
|
|
|
- name: Make gradlew executable
|
|
run: |
|
|
cd "$GITHUB_WORKSPACE"
|
|
chmod +x ./gradlew
|
|
|
|
- name: Run JUnit tests
|
|
id: run_tests
|
|
run: |
|
|
cd "$GITHUB_WORKSPACE"
|
|
./gradlew test --no-daemon --stacktrace
|
|
|
|
- name: Upload test reports
|
|
if: always()
|
|
run: |
|
|
cd "$GITHUB_WORKSPACE"
|
|
if [ -d "build/reports/tests/test" ]; then
|
|
echo "Test reports available in build/reports/tests/test"
|
|
ls -la build/reports/tests/test || true
|
|
fi
|
|
if [ -d "build/test-results/test" ]; then
|
|
echo "Test result XMLs:"
|
|
ls -la build/test-results/test || true
|
|
fi
|