-
Notifications
You must be signed in to change notification settings - Fork 78
104 lines (90 loc) · 2.61 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
93
94
95
96
97
98
99
100
101
102
103
104
name: Build
on:
push:
branches:
- "*"
pull_request:
branches:
- main
jobs:
integration-tests:
name: Integration tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sqVersion:
- LATEST_RELEASE[9.9]
- LATEST_RELEASE
- DEV
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: |
11
17
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: build publishToMavenLocal --refresh-dependencies
- name: Build custom rules example
uses: gradle/gradle-build-action@v2
with:
arguments: build
build-root-directory: plsql-custom-rules
- name: Run integration test
uses: gradle/gradle-build-action@v2
with:
arguments: integrationTest -Dsonar.runtimeVersion=${{ matrix.sqVersion }} --info
windows-build:
name: Test on Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: test
linux-build:
name: Build and release
needs: [integration-tests, windows-build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: build --refresh-dependencies
- if: github.ref == 'refs/heads/main'
name: Run SonarQube Scanner
uses: gradle/gradle-build-action@v2
with:
arguments: sonar
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
- if: github.ref == 'refs/heads/main'
name: Release artifacts
uses: gradle/gradle-build-action@v2
with:
arguments: publish jreleaserFullRelease
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_SECRET_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_KEY_PASSWORD }}