From 6bb23e16c8a5a267ac6ebb90a78e598f047828fa Mon Sep 17 00:00:00 2001 From: hideak1 <114559985+hideak1@users.noreply.github.com> Date: Thu, 29 Jun 2023 23:28:22 -0600 Subject: [PATCH] CI configuration, most code are generated by github, we only add cacheing maven packages and set jdk version to 8 --- .github/workflows/unittest.yml | 31 +++++++++++++++++++++++++++++++ README.md | 1 + pom.xml | 22 ++++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 .github/workflows/unittest.yml diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml new file mode 100644 index 00000000..4cd66da1 --- /dev/null +++ b/.github/workflows/unittest.yml @@ -0,0 +1,31 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Maven Build and Test + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 8 + uses: actions/setup-java@v3 + with: + java-version: '8' + distribution: 'zulu' + cache: maven + - name: Build and Test + run: mvn -B test diff --git a/README.md b/README.md index 6bca532e..e00469a2 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ MallChat的后端项目,是一个既能购物又能即时聊天的电商系统

+[![UNIT TEST](https://github.com/zongzibinbin/MallChat/actions/workflows/unittest.yml/badge.svg?branch=main)](https://github.com/zhongzhibinbin/MallChat/actions/workflows/unittest.yml) ## 项目导航 diff --git a/pom.xml b/pom.xml index 93913fa4..ee7912fd 100644 --- a/pom.xml +++ b/pom.xml @@ -46,8 +46,30 @@ 1.15.3 4.8.1 3.17.1 + 2.22.2 + 2.22.0 + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + false + + + + org.apache.maven.surefire + surefire-junit4 + ${surefire-junit4.version} + + + + + +