@@ -2,34 +2,29 @@ name: Java CI
2
2
on :
3
3
push :
4
4
branches :
5
- - master
6
5
- ' [2-9]+.[0-9]+.x'
7
6
pull_request :
8
7
branches :
9
- - master
10
8
- ' [2-9]+.[0-9]+.x'
9
+ env :
10
+ GIT_USER_NAME : puneetbehl
11
+ GIT_USER_EMAIL : behlp@unityfoundation.io
12
+
11
13
jobs :
12
14
13
- build :
15
+ test_project :
14
16
runs-on : ubuntu-latest
15
-
17
+ if : github.event_name == 'pull_request'
16
18
strategy :
17
- fail-fast : false
18
- matrix :
19
- java : [11, 17]
20
-
21
- env :
22
- WORKSPACE : ${{ github.workspace }}
23
- GRADLE_OPTS : -Xmx1500m -Dfile.encoding=UTF-8
24
-
19
+ fail-fast : false
20
+ matrix : { java: [11, 17] }
25
21
steps :
26
22
- uses : actions/checkout@v4
27
23
- uses : gradle/wrapper-validation-action@v2
28
24
- uses : actions/setup-java@v4
29
25
with :
30
26
distribution : temurin
31
27
java-version : ${{ matrix.java }}
32
-
33
28
- name : Run Tests
34
29
if : github.event_name == 'pull_request'
35
30
id : tests
@@ -39,56 +34,55 @@ jobs:
39
34
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER : ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
40
35
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY : ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
41
36
with :
42
- arguments : |
43
- check
44
- -Dgeb.env=chromeHeadless
37
+ arguments : check -Dgeb.env=chromeHeadless
45
38
39
+ build_project :
40
+ runs-on : ubuntu-latest
41
+ if : github.event_name == 'push'
42
+ steps :
43
+ - uses : actions/checkout@v4
44
+ - uses : gradle/wrapper-validation-action@v2
45
+ - uses : actions/setup-java@v4
46
+ with : { java-version: 11, distribution: temurin }
46
47
- name : Run Build
47
- if : github.event_name == 'push'
48
- id : build
49
48
uses : gradle/actions/setup-gradle@v3
50
49
env :
51
50
GRADLE_ENTERPRISE_ACCESS_KEY : ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
52
51
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER : ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
53
52
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY : ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
54
53
with :
55
- arguments : |
56
- build
57
- -Dgeb.env=chromeHeadless
54
+ arguments : build -Dgeb.env=chromeHeadless
58
55
59
- - name : Publish Snapshot to repo.grails.org
60
- id : publish
56
+ - name : Publish Snapshot artifacts to Artifactory ( repo.grails.org)
57
+ if : success()
61
58
uses : gradle/actions/setup-gradle@v3
62
- if : steps.build.outcome == 'success' && github.event_name == 'push' && matrix.java == '11'
63
59
env :
64
- ORG_GRADLE_PROJECT_artifactoryUsername : ${{ secrets.ARTIFACTORY_USERNAME }}
65
- ORG_GRADLE_PROJECT_artifactoryPassword : ${{ secrets.ARTIFACTORY_PASSWORD }}
66
60
GRADLE_ENTERPRISE_ACCESS_KEY : ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
67
61
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER : ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
68
- GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY : ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
62
+ GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY : ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
63
+ ORG_GRADLE_PROJECT_artifactoryPublishUsername : ${{ secrets.ARTIFACTORY_USERNAME }}
64
+ ORG_GRADLE_PROJECT_artifactoryPublishPassword : ${{ secrets.ARTIFACTORY_PASSWORD }}
69
65
with :
70
66
arguments : |
71
67
-Dorg.gradle.internal.publish.checksums.insecure=true
72
68
publish
73
69
74
- - name : Build Docs
75
- id : docs
76
- if : steps.build.outcome == 'success' && github.event_name == 'push' && matrix.java == '11'
70
+ - name : Generate Snapshot Documentation
71
+ if : success()
77
72
uses : gradle/actions/setup-gradle@v3
78
73
env :
79
74
GRADLE_ENTERPRISE_ACCESS_KEY : ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
80
75
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER : ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
81
- GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY : ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
76
+ GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY : ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
82
77
with :
83
78
arguments : views-docs:docs
84
79
85
- - name : Publish Snapshot docs to Github Pages
86
- if : steps.docs.outcome == ' success' && github.event_name == 'push' && matrix.java == '11'
80
+ - name : Publish Snapshot Documentation to Github Pages
81
+ if : success()
87
82
uses : micronaut-projects/github-pages-deploy-action@grails
88
83
env :
89
- TARGET_REPOSITORY : ${{ github.repository }}
90
- GH_TOKEN : ${{ secrets.GH_TOKEN }}
91
84
BRANCH : gh-pages
85
+ COMMIT_EMAIL : ${{ env.GIT_USER_EMAIL }}
86
+ COMMIT_NAME : ${{ env.GIT_USER_NAME }}
92
87
FOLDER : docs/build/docs
93
- COMMIT_EMAIL : behlp@unityfoundation.io
94
- COMMIT_NAME : Puneet Behl
88
+ GH_TOKEN : ${{ secrets.GH_TOKEN }}
0 commit comments