Skip to content

Commit d926fa6

Browse files
committed
Migration to Maven.
Added expression includes/excludes.
1 parent 7a99449 commit d926fa6

24 files changed

+740
-663
lines changed

.github/workflows/build.yml

+44-43
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
name: Build & test
22
on:
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

1311
defaults:
1412
run:
@@ -30,9 +28,9 @@ jobs:
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/[email protected]
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:

.mvn/wrapper/maven-wrapper.jar

61.1 KB
Binary file not shown.

.mvn/wrapper/maven-wrapper.properties

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.3/apache-maven-3.8.3-bin.zip
18+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar

.travis.yml

-102
This file was deleted.

CONTRIBUTING.md

+5-15
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
# Contributing
2-
To develop it locally, you need to setup your maven environment.
3-
4-
### Maven Installation
5-
That's the easy part, you just need to download the Maven binaries and extract it somewhere, then put the maven/bin folder on your PATH.
6-
7-
https://maven.apache.org/install.html
8-
92
*Don't forget to configure your JAVA_HOME environment variable.*
103

114
### Local database with utPLSQL and utPLSQL-demo-project
@@ -18,15 +11,12 @@ If you want to run tests against another database you may set `DB_URL`, `DB_USER
1811

1912
When you have local database set up you can run the complete build including integration tests by executing
2013
```bash
21-
./gradlew build
22-
```
23-
24-
To build the project without local database you may disable integration tests.
25-
```bash
26-
./gradlew build -x intTest
14+
./mvnw verify
2715
```
2816

2917
### Skip the local database part
3018

31-
If you want to skip the local database part, just run ``./gradlew test``.
32-
You will be able to run ``./gradle test`` because integration tests are executed in the separate ``intTest`` task as part of overall ``check``.
19+
If you want to skip the local database part, just run
20+
```bash
21+
./mvnw test
22+
```

0 commit comments

Comments
 (0)