11name : Build & test
22on :
33 push :
4- branches : [ develop ]
5- tags :
6- - v*
4+ branches-ignore : [ main ]
75 pull_request :
86 branches : [ develop ]
97 workflow_dispatch :
108 repository_dispatch :
11- types : [utPLSQL-build]
9+ types : [ utPLSQL-build ]
1210
1311defaults :
1412 run :
3028 strategy :
3129 fail-fast : false
3230 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' ]
3634 include :
3735 - utplsql_version : " v3.0.0"
3836 jdk : ' 8'
@@ -70,47 +68,50 @@ jobs:
7068 - uses : actions/checkout@v2
7169 with :
7270 fetch-depth : 0
73- - uses : actions/setup-java@v2
74- with :
75- distribution : ' adopt'
76- java-version : ${{matrix.jdk}}
77- cache : ' gradle'
7871
79- - name : Install utplsql
80- run : .travis/install_utplsql .sh
72+ - name : Install utPLSQL
73+ run : sh ${{ github.workspace }}/scripts/1_install_utplsql .sh
8174
8275 - name : Install demo project
83- run : .travis/install_demo_project .sh
76+ run : sh ${{ github.workspace }}/scripts/2_install_demo_project .sh
8477
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
10280 with :
81+ java-version : ' 11'
10382 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
11199 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+ uses : EnricoMi/publish-unit-test-result-action@v1.24
112+ if : always()
113+ with :
114+ files : target/**/TEST**.xml
114115
115116 dispatch :
116117 name : Dispatch downstream builds
@@ -121,13 +122,13 @@ jobs:
121122 github.repository == 'utPLSQL/utPLSQL-java-api' && github.base_ref == null && github.ref == 'refs/heads/develop'
122123 strategy :
123124 matrix :
124- repo : ['utPLSQL/utPLSQL-maven-plugin', 'utPLSQL/utPLSQL-cli']
125+ repo : [ 'utPLSQL/utPLSQL-maven-plugin', 'utPLSQL/utPLSQL-cli' ]
125126 steps :
126127 - name : Repository Dispatch
127128 uses : peter-evans/repository-dispatch@v1
128129 with :
129130 token : ${{ secrets.API_TOKEN_GITHUB }}
130- repository : ${{ matrix.repo }}
131+ repository : ${{ matrix.repo }}
131132 event-type : utPLSQL-java-api-build
132133
133134 slack-workflow-status :
0 commit comments