-
-
Notifications
You must be signed in to change notification settings - Fork 24
117 lines (103 loc) · 5.25 KB
/
pullrequests.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# This is a basic workflow to help you get started with Actions
name: Pull Request validation
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
# push:
# branches: [ master ]
pull_request:
types: [opened, reopened, edited]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- uses: actions/setup-java@v1
with:
java-version: '11' # The JDK version to make available on the path.
java-package: jdk+fx # (jre, jdk, or jdk+fx) - defaults to jdk
architecture: x64 # (x64 or x86) - defaults to x64
- name: Prepare environment
run: |
sudo systemctl start mysql
mkdir /home/runner/j-lawyer-backup
mkdir /home/runner/j-lawyer-data
mkdir /home/runner/j-lawyer-data/archivefiles
mkdir /home/runner/j-lawyer-data/emailtemplates
mkdir /home/runner/j-lawyer-data/templates
mkdir /home/runner/j-lawyer-data/mastertemplates
mysql -uroot -h127.0.0.1 -proot -e 'CREATE DATABASE IF NOT EXISTS jlawyerdb;'
sudo apt-get update
sudo apt-get install wget tar ant ant-optional junit4
sudo apt-get install openjfx
wget -O /home/runner/j-lawyer-backup/backups.tar.gz https://www.j-lawyer.org/downloads/travisci/backups/backups.tar.gz
tar -m -xvzf /home/runner/j-lawyer-backup/backups.tar.gz -C /home/runner/j-lawyer-backup
- name: Set up JDK8
uses: AdoptOpenJDK/install-jdk@v1
with:
version: '8'
architecture: x64
- name: Build server with JDK8
# ejb tests fail for some reason...
# run: ant -buildfile j-lawyer-fax/build.xml default && ant -buildfile j-lawyer-server-common/build.xml default && ant -Dj2ee.server.home=/home/travis -buildfile j-lawyer-server-entities/build.xml default && ant -buildfile j-lawyer-server-api/build.xml default && ant -Dj2ee.server.home=/home/travis -buildfile j-lawyer-server/build.xml default test && ant -buildfile j-lawyer-io-common/build.xml default
# run j-lawyer-fax without tests, does not need to access the real account
run: ant -buildfile j-lawyer-fax/build.xml jar javadoc && ant -buildfile j-lawyer-server-common/build.xml jar javadoc && ant -Dj2ee.server.home=/home/travis -buildfile j-lawyer-server-entities/build.xml default && ant -buildfile j-lawyer-server-api/build.xml default && ant -Dj2ee.server.home=/home/travis -buildfile j-lawyer-server/build.xml default && ant -buildfile j-lawyer-io-common/build.xml default
# removed temporarily: && mvn -f j-lawyer-backupmgr/pom.xml clean package test
env:
ftpuser: ${{ secrets.FTPUSER }}
ftppassword: ${{ secrets.FTPPASSWORD }}
ftphost: ${{ secrets.FTPHOST }}
ftphome: ${{ secrets.FTPHOME }}
sipuser: ${{ secrets.SIPUSER }}
sippassword: ${{ secrets.SIPPASSWORD }}
runsontravisci: ${{ secrets.RUNSONTRAVISCI }}
mysqlpwd: root
backupdirectory: /home/runner/j-lawyer-backup
datadirectory: /home/runner/j-lawyer-data
encryptionpwd:
- name: Set up JDK11
uses: AdoptOpenJDK/install-jdk@v1
with:
version: '11'
architecture: x64
targets: 'JDK_11'
- name: populate JAVA_HOME to Java 11
run: echo "JAVA_HOME=$(echo $JDK_11)" >> $GITHUB_ENV
- name: Build client with JDK11
run: ant -buildfile j-lawyer-client/build.xml default
# removed temporarily: && mvn -f j-lawyer-backupmgr/pom.xml clean package test
env:
ftpuser: ${{ secrets.FTPUSER }}
ftppassword: ${{ secrets.FTPPASSWORD }}
ftphost: ${{ secrets.FTPHOST }}
ftphome: ${{ secrets.FTPHOME }}
sipuser: ${{ secrets.SIPUSER }}
sippassword: ${{ secrets.SIPPASSWORD }}
runsontravisci: ${{ secrets.RUNSONTRAVISCI }}
mysqlpwd: root
backupdirectory: /home/runner/j-lawyer-backup
datadirectory: /home/runner/j-lawyer-data
encryptionpwd:
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
with:
args: >
-Dsonar.organization=jlawyerorg
-Dsonar.projectKey=jlawyerorg_j-lawyer-org
-Dsonar.projectName=j-lawyer-org
-Dsonar.projectVersion=2.2.0
-Dsonar.java.binaries=.
-Dsonar.java.source=8
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
JAVA_HOME: '' # Avoid 'java: not found' error