-
Notifications
You must be signed in to change notification settings - Fork 3
37 lines (37 loc) · 1.18 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Build
on:
push:
branches:
- "**"
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Setup JDK
uses: actions/setup-java@v2
with:
distribution: "adopt"
java-version: "8"
- name: mvn Install
run: mvn -B -P cicd install -DskipTests=true
- name: mvn test
run: |
sudo apt-get update
sudo apt-get install -y libgtk2.0-0
xvfb-run --auto-servernum -s "-screen 0 1024x768x24" mvn -B -P cicd test -Dsurefire.excludesFile=${GITHUB_WORKSPACE}/.mvn/cicd-test-excludes
- name: Cleanup xvfb
uses: bcomnes/cleanup-xvfb@v1
- name: Publish to GitHub Packages Apache Maven
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' }}
run: mvn -B -P cicd deploy -DskipTests=true
env:
GITHUB_TOKEN: ${{ github.token }}