From 8a50105183198f70cdc3b36f70bfb6ef250787f6 Mon Sep 17 00:00:00 2001 From: Kaiser-Yang <624626089@qq.com> Date: Fri, 18 Oct 2024 19:53:47 +0800 Subject: [PATCH] Add git-action for running maven test This solved #11. --- .github/workflows/mvn-test.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/mvn-test.yml diff --git a/.github/workflows/mvn-test.yml b/.github/workflows/mvn-test.yml new file mode 100644 index 0000000..1c59429 --- /dev/null +++ b/.github/workflows/mvn-test.yml @@ -0,0 +1,34 @@ +name: Maven Test +on: + pull_request: + branches: [ master, develop ] + +jobs: + maven-test: + # Containers must run in Linux based operating systems + runs-on: ubuntu-latest + services: + # Label used to access the service container + postgres: + # Docker Hub image + image: postgres + # Provide the password for postgres + env: + POSTGRES_PASSWORD: postgres + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + steps: + - name: Check out repository code + uses: actions/checkout@v4 + with: + token: ${{ secrets.PAT }} + - name: Preparation + run: | + bash prepare_dev.sh postgres + - name: Maven Test + run: | + mvn test