Skip to content

Commit b2aff76

Browse files
authored
Merge pull request #2119 from hazendaz/master
Github Actions - Adjust OS usage, sonatype push add, skip license check due to shallow clone, sonar, adjustments to travis
2 parents d8270a5 + ea7ad74 commit b2aff76

File tree

7 files changed

+141
-14
lines changed

7 files changed

+141
-14
lines changed

.github/workflows/ci.yaml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
1-
---
1+
#
2+
# Copyright 2009-2020 the original author or authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
217
name: Java CI
318

419
on: [push]
@@ -8,19 +23,17 @@ jobs:
823
runs-on: ${{ matrix.os }}
924
strategy:
1025
matrix:
11-
os: [ubuntu-18.04, macOS-latest, windows-2016]
26+
os: [ubuntu-latest, macOS-latest, windows-latest]
1227
java: [8, 11, 15, 16-ea]
1328
fail-fast: false
1429
max-parallel: 4
1530
name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}
1631

1732
steps:
18-
- uses: actions/checkout@v1
33+
- uses: actions/checkout@v2
1934
- name: Set up JDK
2035
uses: actions/setup-java@v1
2136
with:
2237
java-version: ${{ matrix.java }}
2338
- name: Test with Maven
24-
run: mvn test -B --file pom.xml
25-
26-
...
39+
run: ./mvnw test -B -D"license.skip=true"

.github/workflows/sonar.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#
2+
# Copyright 2009-2020 the original author or authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
name: SonarCloud
18+
19+
on:
20+
push:
21+
branches:
22+
- master
23+
24+
jobs:
25+
build:
26+
if: github.repository_owner == 'mybatis'
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v2
30+
with:
31+
# Disabling shallow clone is recommended for improving relevancy of reporting
32+
fetch-depth: 0
33+
- name: Set up JDK
34+
uses: actions/setup-java@v1
35+
with:
36+
java-version: 11
37+
- name: Analyze with SonarCloud
38+
run: ./mvnw verify sonar:sonar -B -Dsonar.projectKey=mybatis_mybatis-3 -Dsonar.organization=mybatis -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN -Dlicense.skip=true
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/sonatype.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#
2+
# Copyright 2009-2020 the original author or authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
name: Sonatype
18+
19+
on:
20+
push:
21+
branches:
22+
- master
23+
24+
jobs:
25+
build:
26+
if: github.repository_owner == 'mybatis' && ! contains(toJSON(github.event.head_commit.message), '[maven-release-plugin]')
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v2
30+
- name: Set up JDK
31+
uses: actions/setup-java@v1
32+
with:
33+
java-version: 11
34+
- name: Deploy to Sonatype
35+
run: ./mvnw deploy -DskipTests -B --settings ./.mvn/settings.xml -Dlicense.skip=true
36+
env:
37+
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
38+
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}

.mvn/extensions.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Copyright 2009-2020 the original author or authors.
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
18+
-->
19+
<extensions>
20+
<extension>
21+
<groupId>fr.jcgay.maven</groupId>
22+
<artifactId>maven-profiler</artifactId>
23+
<version>3.0</version>
24+
</extension>
25+
</extensions>

travis/settings.xml renamed to .mvn/settings.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
4-
Copyright 2009-2016 the original author or authors.
4+
Copyright 2009-2020 the original author or authors.
55
66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.
@@ -26,8 +26,11 @@
2626
</server>
2727
<server>
2828
<id>gh-pages</id>
29-
<username>git</username>
30-
<password>${env.CI_SITE_PASSWORD}</password>
29+
</server>
30+
<server>
31+
<id>github</id>
32+
<username>${env.CI_DEPLOY_USERNAME}</username>
33+
<password>${env.GITHUB_TOKEN}</password>
3134
</server>
3235
</servers>
3336
</settings>

pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,13 @@
279279
<version>1.14.3</version>
280280
<scope>test</scope>
281281
</dependency>
282+
<!-- For javadoc link -->
283+
<dependency>
284+
<groupId>com.microsoft.sqlserver</groupId>
285+
<artifactId>mssql-jdbc</artifactId>
286+
<version>8.4.1.jre8</version>
287+
<scope>provided</scope>
288+
</dependency>
282289
</dependencies>
283290

284291
<build>

travis/after_success.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
#
3-
# Copyright 2009-2019 the original author or authors.
3+
# Copyright 2009-2020 the original author or authors.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -36,21 +36,21 @@ if [ $TRAVIS_REPO_SLUG == "mybatis/mybatis-3" ] && [ "$TRAVIS_PULL_REQUEST" == "
3636
if [ $TRAVIS_JDK_VERSION == "openjdk8" ]; then
3737

3838
# Deploy to sonatype
39-
./mvnw clean deploy -Dmaven.test.skip=true -q --settings ./travis/settings.xml
39+
./mvnw clean deploy -Dmaven.test.skip=true -q --settings ./mvn/settings.xml
4040
echo -e "Successfully deployed SNAPSHOT artifacts to Sonatype under Travis job ${TRAVIS_JOB_NUMBER}"
4141

42-
./mvnw clean test jacoco:report coveralls:report -q --settings ./travis/settings.xml
42+
./mvnw clean test jacoco:report coveralls:report -q --settings ./mvn/settings.xml
4343
echo -e "Successfully ran coveralls under Travis job ${TRAVIS_JOB_NUMBER}"
4444

4545
./mvnw sonar:sonar -Dsonar.projectKey=mybatis_mybatis-3
4646

4747
# Deploy to site
4848
# Cannot currently run site this way
49-
# ./mvnw site site:deploy -q --settings ./travis/settings.xml
49+
# ./mvnw site site:deploy -q --settings ./mvn/settings.xml
5050
# echo -e "Successfully deploy site under Travis job ${TRAVIS_JOB_NUMBER}"
5151

5252
# Deploy to sonar
53-
./mvnw clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=ccf0be39fd0ca5ea5aa712247c79da7233cd3caa -q --settings ./travis/settings.xml
53+
./mvnw clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=ccf0be39fd0ca5ea5aa712247c79da7233cd3caa -q --settings ./mvn/settings.xml
5454
echo -e "Successfully ran Sonar integration under Travis job ${TRAVIS_JOB_NUMBER}"
5555
else
5656
echo "Java Version does not support additonal activity for travis CI"

0 commit comments

Comments
 (0)