Skip to content

Commit

Permalink
Add GitHub action to validate build and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
darronschall committed Sep 6, 2024
1 parent 78424ba commit 7ed47c5
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build and Test

on:
pull_request:
paths-ignore:
- "**.md"
push:
branches:
- main
workflow_dispatch:

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v3

- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.konan
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Setup Java 21
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21

- name: Build
run: ./gradlew build

- name: Test
run: ./gradlew test

- name: Archive Runtime Test Report
if: success() || failure() # Allow canceling per https://stackoverflow.com/a/73015952
uses: actions/upload-artifact@v4
with:
name: testReleaseUnitTest report
path: oauth-core/build/reports/tests/testReleaseUnitTest

0 comments on commit 7ed47c5

Please sign in to comment.