-
Notifications
You must be signed in to change notification settings - Fork 7
86 lines (73 loc) · 2.19 KB
/
continuous-integration.yaml
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
name: Continuous Integration (CI)
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
paths-ignore:
- ".github/**"
- "java-module/**.md"
- "java-module/conf/**"
- "java-module/.env.sample"
- "java-module/swagger/**"
- "**.md"
- "LICENSE"
- ".gitignore"
- "go/**"
- "python/**"
jobs:
build-source-chk:
name: Check source code
strategy:
matrix:
os: [ubuntu-22.04]
runs-on: ${{matrix.os}}
steps:
- name: Remove unused data
run: docker system prune -a -f
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Test build & image create
run: echo 'gradle build & docker build'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
- name: grant execute permission for gradlew
run: chmod +x java-module/gradlew
shell: bash
- name: Build with Gradle Wrapper
run: java-module/gradlew -p java-module test
build-source-and-container-image:
name: Build a container image
runs-on: ubuntu-22.04
needs: build-source-chk
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: grant execute permission for gradlew
run: chmod +x java-module/gradlew
shell: bash
- name: Build with Gradle Wrapper
run: java-module/gradlew -p java-module clean build --stacktrace
- name: chk directory
run: ls -al
- name: Build image (Observability-Manager)
env:
IMAGE_NAME: mc-observability
run: docker build . --file java-module/Dockerfile --tag $IMAGE_NAME
#
# - name: Build image (Observability-Agent)
# env:
# IMAGE_NAME: mc-observability-agent
# run: docker build . --file java-module/mc-o11y-agent/Dockerfile --tag $IMAGE_NAME