-
-
Notifications
You must be signed in to change notification settings - Fork 114
122 lines (99 loc) · 3.36 KB
/
github.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
jdk-version: [ 8, 11, 17 ]
steps:
- uses: actions/checkout@v4
- name: Setup Java ${{ matrix.jdk-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jdk-version }}
distribution: 'adopt'
- name: Gradle cache
uses: actions/cache@v4
with:
path: ~/.gradle
key: gradle
- name: Maven cache
uses: actions/cache@v4
with:
path: ~/.m2
key: m2
- name: Loading ivy cache
uses: actions/cache@v4
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-ivy-${{ hashFiles('**/*.sbt') }}
restore-keys: |
${{ runner.os }}-ivy-
- name: Build library
run: ./gradlew build publishToMavenLocal publishAllPublicationsToIvyRepository --warning-mode all
- name: Build maven plugin
working-directory: plugins/maven/graphql-java-codegen-maven-plugin
run: mvn install
- name: Build maven example-server
working-directory: plugins/maven/example-server
run: mvn package
- name: Build maven example-client
working-directory: plugins/maven/example-client
run: mvn package
- name: Build gradle plugin
run: ./gradlew -p plugins/gradle/graphql-java-codegen-gradle-plugin build publishToMavenLocal --warning-mode all
- name: Build gradle example-server
run: ./gradlew -p plugins/gradle/example-server test --warning-mode all
- name: Build gradle example-client
run: ./gradlew -p plugins/gradle/example-client test --warning-mode all
- name: Build gradle example-client-kotlin
run: ./gradlew -p plugins/gradle/example-client-kotlin build --warning-mode all
- name: Build sbt plugin
working-directory: plugins/sbt/graphql-java-codegen-sbt-plugin
run: sbt compile publishLocal --debug
- name: Build sbt test
working-directory: plugins/sbt/graphql-java-codegen-sbt-plugin
run: sbt scripted
sonar:
needs: build
if: github.event_name != 'pull_request'
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: 'adopt'
- name: Gradle cache
uses: actions/cache@v4
with:
path: ~/.gradle
key: gradle
- name: Maven cache
uses: actions/cache@v4
with:
path: ~/.m2
key: m2
- name: Loading ivy cache
uses: actions/cache@v4
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-ivy-${{ hashFiles('**/*.sbt') }}
restore-keys: |
${{ runner.os }}-ivy-
- name: Generate code coverage report
run: ./gradlew codeCoverageReport --stacktrace
- name: Generate and publish Sonar report
run: ./gradlew sonarqube -Dsonar.projectKey=kobylynskyi_graphql-java-codegen -Dsonar.organization=kobylynskyi -Dsonar.host.url=https://sonarcloud.io -Dsonar.token=${{ secrets.SONAR_TOKEN }} --stacktrace
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}