add github action

This commit is contained in:
weihu 2023-12-26 15:15:16 +08:00
parent 5a48f9d5c9
commit 3c8b7ef544
1 changed files with 36 additions and 0 deletions

36
.github/workflow/junit_test.yml vendored Normal file
View File

@ -0,0 +1,36 @@
name: Test with Junit
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
junit:
strategy:
matrix:
java: [ 8, 11, 17 ]
os: [ 'windows-latest', 'ubuntu-latest' ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout codes
uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Test with Maven
run: mvn clean test -B -U -Psonatype