-
Notifications
You must be signed in to change notification settings - Fork 3
185 lines (146 loc) · 5.71 KB
/
maven.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Maestro2
on:
workflow_dispatch:
push:
branches-ignore:
- master
pull_request:
env:
JAVA_VERSION: 11.0.3
SERVER_ID: ossrh
PYTHON_VERSION: '3.12.2'
MAVEN_VERSION: 3.8.1
WINDOWS_VERSION: 'windows-2019'
MACOS_VERSION: 'macos-latest-large'
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, windows-2019, macos-latest ]
steps:
- name: Set up Java
uses: actions/[email protected]
with:
java-version: ${{ env.JAVA_VERSION }}
- name: Set up maven
uses: stCarolas/[email protected]
with:
maven-version: ${{ ENV.MAVEN_VERSION }}
- name: Put MSYS2_MinGW64 on PATH for windows
if: ${{matrix.os == env.WINDOWS_VERSION }}
# there is not yet an environment variable for this path from msys2/setup-msys2
run: echo "C:\msys64/mingw64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- uses: actions/checkout@v2
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Maven Build
run: mvn -B package --file pom.xml -DskipTests -fae
- name: Maven Test
# if: matrix.os == env.WINDOWS_VERSION
# shell: msys2 {0}
run: mvn -Pinclude-fullSpecCppTest test
# - name: Maven Test
# if: matrix.os != env.WINDOWS_VERSION
# run: mvn test -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
- name: upload test reports win
uses: actions/upload-artifact@v2
if: ${{ failure() && matrix.os == env.WINDOWS_VERSION}}
with:
name: surfire-win
path: |
**/target/surefire-reports/*
**/target/FullSpecCppTest/spec.mabl
**/target/FullSpecCppTest/co-sim.cxx
retention-days: 1
- name: upload test reports ubuntu
uses: actions/upload-artifact@v2
if: ${{ failure() && matrix.os == 'ubuntu-22.04' }}
with:
name: surfire-ubuntu
path: |
**/target/surefire-reports/*
retention-days: 1
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Python Dependencies
run: |
cd external_tester
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: CLI Test
timeout-minutes: 5
run: |
cd external_tester
python maestro_cli_test.py --includeSlowTests
- name: Web API Test
timeout-minutes: 2
run: |
cd external_tester
python webapi_test.py
- name: Legacy CLI Test
timeout-minutes: 2
run: |
cd external_tester
python cli_legacy_test.py
#- name: Threaded Web API test
# timeout-minutes: 5
# run: |
# cd external_tester
# python test_simultaneous_simulations.py
deploy:
needs: build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Environment variables
run: echo ${{ env.SERVER_ID }}
- id: install-secret-key
name: Install gpg secret key
run: |
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}
server-id: ${{ env.SERVER_ID }}
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Set up maven
uses: stCarolas/[email protected]
with:
maven-version: ${{ ENV.MAVEN_VERSION }}
- name: Maven Package feature SNAPSHOT
if: github.event_name == 'push' && (github.ref != 'refs/heads/development' && github.ref != 'refs/heads/master' )
run: mvn -Psonatype -B package -Dsha1=-`git rev-parse --abbrev-ref HEAD | sed "s|/|-|g;s|#||g;s|<||g;s|>||g;s|:||g;s|\"||g;s|/||g;s|\|||g;s|?||g;s|*||g;s|;||g"` -fae -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
env:
MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- name: Maven Package SNAPSHOT
if: github.event_name == 'push' && (github.ref == 'refs/heads/development' )
run: mvn -Psonatype -B deploy -Dsha1= -fae -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
env:
MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}