1
1
name : Build & test
2
2
on :
3
3
push :
4
- branches : [ develop ]
5
- tags :
6
- - v*
4
+ branches-ignore : [ main ]
7
5
pull_request :
8
6
branches : [ develop ]
9
7
workflow_dispatch :
10
8
repository_dispatch :
11
- types : [utPLSQL-build]
9
+ types : [ utPLSQL-build ]
12
10
13
11
defaults :
14
12
run :
30
28
strategy :
31
29
fail-fast : false
32
30
matrix :
33
- utplsql_version : ["v3.0.1","v3.0.2","v3.0.3","v3.0.4","v3.1.1","v3.1.2","v3.1.3","v3.1.6","v3.1.7","v3.1.8","v3.1.9","v3.1.10","v3.1.11","develop"]
34
- utplsql_file : ["utPLSQL"]
35
- jdk : ['8']
31
+ utplsql_version : [ "v3.0.1","v3.0.2","v3.0.3","v3.0.4","v3.1.1","v3.1.2","v3.1.3","v3.1.6","v3.1.7","v3.1.8","v3.1.9","v3.1.10","v3.1.11","v3.1.13"," develop" ]
32
+ utplsql_file : [ "utPLSQL" ]
33
+ jdk : [ '8' ]
36
34
include :
37
35
- utplsql_version : " v3.0.0"
38
36
jdk : ' 8'
@@ -70,47 +68,50 @@ jobs:
70
68
- uses : actions/checkout@v2
71
69
with :
72
70
fetch-depth : 0
73
- - uses : actions/setup-java@v2
74
- with :
75
- distribution : ' adopt'
76
- java-version : ${{matrix.jdk}}
77
- cache : ' gradle'
78
71
79
- - name : Install utplsql
80
- run : .travis/install_utplsql .sh
72
+ - name : Install utPLSQL
73
+ run : sh ${{ github.workspace }}/scripts/1_install_utplsql .sh
81
74
82
75
- name : Install demo project
83
- run : .travis/install_demo_project .sh
76
+ run : sh ${{ github.workspace }}/scripts/2_install_demo_project .sh
84
77
85
- - name : Build and test
86
- run : ./gradlew check
87
-
88
- deploy :
89
- name : Deploy snapshot
90
- needs : [ build ]
91
- concurrency : deploy
92
- runs-on : ubuntu-latest
93
- if : |
94
- github.repository == 'utPLSQL/utPLSQL-java-api' &&
95
- github.base_ref == null &&
96
- (github.ref == 'refs/heads/develop' || startsWith( github.ref, 'refs/tags/v' ) )
97
- steps :
98
- - uses : actions/checkout@v2
99
- with :
100
- fetch-depth : 0
101
- - uses : actions/setup-java@v2
78
+ - name : Set up JDK 11
79
+ uses : actions/setup-java@v2
102
80
with :
81
+ java-version : ' 11'
103
82
distribution : ' adopt'
104
- java-version : ' 8'
105
- cache : ' gradle'
106
- - name : Set env variable
107
- uses : FranzDiebold/github-env-vars-action@v2 # https://github.com/marketplace/actions/github-environment-variables-action
108
- - name : Set CI_TAG
109
- run : if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then echo "CI_TAG=${CI_REF_NAME}" >> ${GITHUB_ENV}; fi
110
- - name : Upload archives
83
+ server-id : ossrh
84
+ server-username : MAVEN_USERNAME
85
+ server-password : MAVEN_PASSWORD
86
+ gpg-private-key : ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
87
+ gpg-passphrase : MAVEN_GPG_PASSPHRASE
88
+
89
+ - name : Cache local Maven repository
90
+ uses : actions/cache@v2
91
+ with :
92
+ path : ~/.m2/repository
93
+ key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
94
+ restore-keys : |
95
+ ${{ runner.os }}-maven-
96
+
97
+ - name : Maven unit and integration tests with sonar
98
+ run : mvn clean verify sonar:sonar -Pcoverage -Dsonar.projectKey=org.utplsql:utplsql-maven-plugin
111
99
env :
112
- PACKAGECLOUD_TOKEN : ${{secrets.PACKAGECLOUD_TOKEN}}
113
- run : ./gradlew uploadArchives
100
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
101
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
102
+
103
+ - name : Maven deploy snapshot
104
+ run : mvn deploy -DskipTests
105
+ env :
106
+ MAVEN_USERNAME : ${{ secrets.OSSRH_USERNAME }}
107
+ MAVEN_PASSWORD : ${{ secrets.OSSRH_TOKEN }}
108
+ MAVEN_GPG_PASSPHRASE : ${{ secrets.MAVEN_GPG_PASSPHRASE }}
109
+
110
+ - name : Publish unit test results
111
+
112
+ if : always()
113
+ with :
114
+ files : target/**/TEST**.xml
114
115
115
116
dispatch :
116
117
name : Dispatch downstream builds
@@ -121,13 +122,13 @@ jobs:
121
122
github.repository == 'utPLSQL/utPLSQL-java-api' && github.base_ref == null && github.ref == 'refs/heads/develop'
122
123
strategy :
123
124
matrix :
124
- repo : ['utPLSQL/utPLSQL-maven-plugin', 'utPLSQL/utPLSQL-cli']
125
+ repo : [ 'utPLSQL/utPLSQL-maven-plugin', 'utPLSQL/utPLSQL-cli' ]
125
126
steps :
126
127
- name : Repository Dispatch
127
128
uses : peter-evans/repository-dispatch@v1
128
129
with :
129
130
token : ${{ secrets.API_TOKEN_GITHUB }}
130
- repository : ${{ matrix.repo }}
131
+ repository : ${{ matrix.repo }}
131
132
event-type : utPLSQL-java-api-build
132
133
133
134
slack-workflow-status :
0 commit comments