Skip to content

Commit

Permalink
Add test actions
Browse files Browse the repository at this point in the history
  • Loading branch information
chanhyeong committed Jul 4, 2024
1 parent 63ca5b0 commit 9f04c83
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Run tests

on:
push:
branches: [ main, '[0-9]*.[0-9]*.x' ]
pull_request:
branches: [ main, '[0-9]*.[0-9]*.x' ]
workflow_dispatch:

env:
JDK_VERSION: 17

jobs:
static-analysis:
name: Static analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ env.JDK_VERSION }}
- name: Execute check without tests
uses: gradle/gradle-build-action@v3
with:
arguments: check -x test
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ env.JDK_VERSION }}

- name: Build
uses: gradle/gradle-build-action@v3
with:
arguments: build -x test

- name: Execute tests
uses: gradle/gradle-build-action@v3
with:
arguments: test
env:
CI: Github Action

- name: Publish test report
uses: mikepenz/[email protected]
if: always() # always run even if the previous step fails
with:
check_name: JUnit Test Report
report_paths: '**/build/test-results/test/TEST-*.xml'
detailed_summary: true

- name: Test Summary
uses: actions/[email protected] # upload test results
if: always()
with:
name: test-results
path: '**/build/test-results/test/TEST-*.xml'

0 comments on commit 9f04c83

Please sign in to comment.