-
Notifications
You must be signed in to change notification settings - Fork 20
92 lines (88 loc) · 2.65 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
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
name: Build
defaults:
run:
shell: bash
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build_java:
name: Build Java module
timeout-minutes: 15
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 8, 11 ]
steps:
- name: Checkout project
uses: actions/checkout@v2
- name: Setup Java SDK ${{ matrix.java-version }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java-version }}
- name: Cache local Maven repository
uses: actions/cache@v2
env:
cache-name: cache-maven-packages
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Display system info
run: |
echo "Maven version: $(mvn --version)"
- name: Run build script for Java
run: |
LAST_COMMIT_MSG=$(git log -1 --pretty=format:"%s")
if [[ ("$LAST_COMMIT_MSG" == '[maven-release-plugin] prepare release'* ) ]] ; then
echo 'Skipping build for release preparation step.'
exit 0
fi
echo 'Compile, test (no IT tests) and build jarviz-lib module.'
mvn clean install -DskipITs
build_node:
name: Build Node module
timeout-minutes: 15
needs: build_java
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 12.x ]
steps:
- name: Checkout project
uses: actions/checkout@v2
- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
restore-keys: ${{ runner.os }}-npm
- name: Display system info
run: |
echo "Node version: $(node -v)"
echo "NPM version: $(npm -v)"
- name: Run build script for Node
run: |
LAST_COMMIT_MSG=$(git log -1 --pretty=format:"%s")
if [[ ("$LAST_COMMIT_MSG" == '[maven-release-plugin] prepare release'* ) ]] ; then
echo 'Skipping build for release preparation step.'
exit 0
fi
JARVIZ_HOME="$(pwd)"
cd ./jarviz-graph
echo 'Installing jarviz-graph'
npm install
echo 'Building jarviz-graph'
npm run build
cd "${JARVIZ_HOME}"
echo 'Done'