-
Notifications
You must be signed in to change notification settings - Fork 4
56 lines (47 loc) · 1.32 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
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- name: Build and test
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}}
run: ./mvnw -B clean verify
- name: Check whether SONAR_TOKEN is set
id: is-sonar-set
env:
SONAR_IS_SET: ${{ secrets.SONAR_TOKEN }}
run: |
echo "Is Sonar Set: ${{ env.SONAR_IS_SET != '' }}"
echo "sonar-enable=${{ env.SONAR_IS_SET != '' }}" >> $GITHUB_OUTPUT
- name: Run Sonar
if: ${{ steps.is-sonar-set.outputs.sonar-enable == 'true' }}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}}
run: ./mvnw -B sonar:sonar -Dsonar.login=${{ secrets.SONAR_TOKEN }}
- name: Copy artifacts for staging
run: |
mkdir staging
cp target/*.zip staging
cp target/*.jar staging
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: Connectors
path: staging