build: add pr check

This commit is contained in:
maliang
2024-05-24 17:47:16 +08:00
committed by Charles7c
parent cf18c1046b
commit c34e703fd3
5 changed files with 88 additions and 40 deletions

28
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,28 @@
name: Build
on:
pull_request:
branches:
- dev
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
jdk-version:
- 17
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "adopt"
java-version: ${{ matrix.jdk-version }}
cache: "maven"
- name: Compile
run: |
sed -i.bak '/<repositories>/,/<\/repositories>/d' pom.xml
sed -i.bak '/<pluginRepositories>/,/<\/pluginRepositories>/d' pom.xml
mvn -B compile --file pom.xml