From 88348990e7b2d9bd64dddc5b1540470e16fcb8a7 Mon Sep 17 00:00:00 2001 From: Oleh Astappiev Date: Wed, 20 Sep 2023 23:45:29 +0200 Subject: [PATCH] chore: add ci workflow for tests --- .github/workflows/publish.yml | 3 +-- .github/workflows/test.yml | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ac2fc962..b3e2e1e1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,7 +2,6 @@ name: publish on: push: - branches: [ "main" ] tags: - '*' @@ -43,7 +42,7 @@ jobs: name: deploy image runs-on: ubuntu-latest steps: - - uses: appleboy/ssh-action@v1 + - uses: appleboy/ssh-action@v1.0.0 with: host: ${{ secrets.DEPLOY_HOST }} username: ${{ secrets.DEPLOY_USERNAME }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..b366ac85 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,31 @@ +name: test + +on: + push: + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + env: + MVN: mvn --show-version --batch-mode + steps: + - uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - uses: actions/checkout@v4 + + - name: cache ~/.m2 + uses: actions/cache@v3 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + + - name: run compile + run: $MVN clean compile + + - name: run test + run: $MVN test -pl '!:interweb-server'