-
Notifications
You must be signed in to change notification settings - Fork 2
92 lines (83 loc) · 3.06 KB
/
maven_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
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Build
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
if: github.repository == 'IcarusDB/metal'
runs-on: ubuntu-latest
steps:
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 8
- uses: actions/checkout@v3
- name: Filter Changes
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
ui:
- 'metal-ui/**'
mod:
- 'metal-backend/**'
- 'metal-backend-api/**'
- 'metal-core/**'
- 'metal-dist/**'
- 'metal-maven-plugin/**'
- 'metal-on-spark/**'
- 'metal-on-spark-extensions/**'
- 'metal-parent/**'
- 'metal-server/**'
ci:
- '.github/workflows/**.yml'
chore:
- '**.md'
- 'doc/**'
- 'LICENSE'
- 'licenses/**'
- name: Filters
run: |
echo 'ci:'${{ steps.changes.outputs.ci }}
echo 'ui:'${{ steps.changes.outputs.ui }}
echo 'mod:'${{ steps.changes.outputs.mod }}
echo 'chore:'${{ steps.changes.outputs.chore }}
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- if: ${{ steps.changes.outputs.ci == 'true' }}
name: Build on CI changed
id: ci
run: |
echo 'CI has been changed, the whole build will execute.'
mvn clean package -B -pl metal-dist -am -Dmaven.test.skip=true
- if: ${{ steps.changes.outputs.ci == 'false' && steps.changes.outputs.ui == 'true' }}
name: Build on metal-ui changed
id: ui
run: |
echo 'metal-ui has been updated, the whole build will execute.'
mvn clean package -B -pl metal-dist -am -Dmaven.test.skip=true
- if: ${{ steps.changes.outputs.ci == 'false' && steps.changes.outputs.ui == 'false' && steps.changes.outputs.mod == 'true' }}
name: Build on modules changed
id: mod
run: |
echo 'Some modules has been changed, except metal-ui, the build will skip metal-ui.'
mvn clean package -B -pl metal-dist -am -Dmaven.test.skip=true -Dskip.npm
- if: ${{ steps.changes.outputs.ci == 'false' && steps.changes.outputs.ui == 'false' && steps.changes.outputs.mod == 'false' && steps.changes.outputs.chore == 'true' }}
name: Skip build on chores changed
id: chore
run: |
echo 'Just some chore files have been updated, it will skip build.'
- name: Finish
run: echo 'Build is finished.'