-
Notifications
You must be signed in to change notification settings - Fork 10
103 lines (95 loc) · 2.8 KB
/
main.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
# This is the main CI workflow it verify that SEPA builds and it conformates to the defined tests
name: CI
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
tags:
- "v*"
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 13
uses: actions/setup-java@v2
with:
java-version: '13'
distribution: 'adopt'
cache: maven
- name: Build with Maven
run: mvn --batch-mode --update-snapshots compile
test:
runs-on: ubuntu-latest
needs: build
services:
blazegraph:
image: nawer/blazegraph:2.1.5
ports:
- 9999:9999
steps:
- uses: actions/checkout@v2
- name: Set up JDK 13
uses: actions/setup-java@v2
with:
java-version: '13'
distribution: 'adopt'
cache: maven
- name: wait for blazegraph
uses: nev7n/wait_for_response@v1
with:
url: 'http://localhost:9999/blazegraph/namespace/kb/sparql'
responseCode: 200
timeout: 20000
interval: 500
- name: package engine and launch
run: |
mvn package
cd engine/target
mv endpoints/endpoint-blazegraph.jpar endpoint.jpar
echo launching engine with this configuration
echo SPARQL ENDPOINT
cat endpoint.jpar
echo ENGINE PROPERTIES
cat engine.jpar
echo LOG4J
cat log4j2.xml
java -Dlog4j.configurationFile=./log4j2.xml -jar engine-1.0.0-SNAPSHOT.jar -engine engine.jpar -endpoint endpoint.jpar > log.txt &
shell: bash
- name: wait for SEPA engine
uses: nev7n/wait_for_response@v1
with:
url: 'http://localhost:8000/echo'
responseCode: 200
timeout: 20000
interval: 500
- name: verify
run: mvn verify -e -Dlog4j2.level=trace
- name: Archive code coverage results
uses: actions/upload-artifact@v2
with:
name: engine-log
path: engine/target/log.txt
publish:
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
needs:
- build
- test
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
java-version: '13'
distribution: 'adopt'
cache: maven
- name: Publish package
run: mvn clean deploy -Dmaven.test.skip=true -Drevision=${{github.ref_name}} -DrepositoryId=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}