-
Notifications
You must be signed in to change notification settings - Fork 12
83 lines (82 loc) · 2.95 KB
/
on_push_master.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
name: Snapshot
on:
push:
branches: [ master ]
jobs:
build-linux:
runs-on: ubuntu-latest
environment: Build
steps:
- name: Docker Login
uses: docker/[email protected]
with:
username: ${{ secrets.MICHELIN_DOCKER_HUB_USERNAME }}
password: ${{ secrets.MICHELIN_DOCKER_HUB_PASSWD }}
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- uses: DeLaGuardo/[email protected]
with:
graalvm: '21.1.0'
java: 'java11'
- name: Install Native Image
run: gu install native-image
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Gradle packages
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build jacocoTestReport sonarqube --info
- name: Push ns4kafka and kafkactl
run: ./gradlew dockerBuild api:dockerPush cli:dockerPush
- name: Native Image for CLI
run: ./gradlew :cli:shadowJar :cli:nativeImage
- uses: actions/upload-artifact@v2
with:
name: native-image-linux
path: ${{ github.workspace }}/cli/build/native-image/kafkactl-*
- uses: actions/upload-artifact@v2
with:
name: jar
path: ${{ github.workspace }}/cli/build/libs/kafkactl-*.jar
build-windows:
runs-on: windows-latest
environment: Build
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- uses: DeLaGuardo/[email protected]
with:
graalvm: '20.3.2'
java: 'java11'
- name: Install Native Image
run: ${{ env.JAVA_HOME }}\bin\gu.cmd install native-image
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Configure Pagefile
uses: al-cheb/[email protected]
- name: Native Image for CLI
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
gradlew.bat :cli:shadowJar :cli:nativeImage
shell: cmd
- uses: actions/upload-artifact@v2
with:
name: native-image-windows
path: ${{ github.workspace }}/cli/build/native-image/kafkactl-*.exe