Skip to content

Commit a3504e9

Browse files
authored
Merge pull request #179 from hazendaz/master
Board github actions
2 parents 671453a + cfedd4c commit a3504e9

File tree

8 files changed

+156
-48
lines changed

8 files changed

+156
-48
lines changed

.github/workflows/ci.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#
2+
# Copyright 2010-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: Java CI
18+
19+
on: [push, pull_request]
20+
21+
jobs:
22+
test:
23+
runs-on: ${{ matrix.os }}
24+
strategy:
25+
matrix:
26+
os: [ubuntu-latest, macOS-latest]
27+
java: [8, 11]
28+
fail-fast: false
29+
max-parallel: 4
30+
name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}
31+
32+
steps:
33+
- uses: actions/checkout@v2
34+
- name: Set up JDK
35+
uses: actions/setup-java@v1
36+
with:
37+
java-version: ${{ matrix.java }}
38+
- name: Test with Maven
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 2010-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_migrations -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 2010-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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<extensions>
3+
<extension>
4+
<groupId>fr.jcgay.maven</groupId>
5+
<artifactId>maven-profiler</artifactId>
6+
<version>3.0</version>
7+
</extension>
8+
</extensions>

.mvn/settings.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
4+
<servers>
5+
<server>
6+
<id>ossrh</id>
7+
<username>${env.CI_DEPLOY_USERNAME}</username>
8+
<password>${env.CI_DEPLOY_PASSWORD}</password>
9+
</server>
10+
<server>
11+
<id>gh-pages</id>
12+
</server>
13+
<server>
14+
<id>github</id>
15+
<username>${env.CI_DEPLOY_USERNAME}</username>
16+
<password>${env.GITHUB_TOKEN}</password>
17+
</server>
18+
</servers>
19+
</settings>

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
language: java
22

33
jdk:
4-
- openjdk11
54
- openjdk8
65

76
script: ./mvnw test -Djacoco.skip=true -B

travis/after_success.sh

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,27 @@ echo "Current commit detected: ${commit_message}"
2323
# We build for several JDKs on Travis.
2424
# Some actions, like analyzing the code (Coveralls) and uploading
2525
# artifacts on a Maven repository, should only be made for one version.
26-
27-
# If the version is 1.6, then perform the following actions.
28-
# 1. Upload artifacts to Sonatype.
29-
# 2. Use -q option to only display Maven errors and warnings.
30-
# 3. Use --settings to force the usage of our "settings.xml" file.
31-
# 4. Notify Coveralls.
32-
# 5. Deploy site
26+
27+
# If the version is 1.8, then perform the following actions.
28+
# 1. Notify Coveralls.
29+
# 2. Deploy site (disabled as solution not complete).
30+
31+
# Parameters
32+
# 1. Use -q option to only display Maven errors and warnings.
33+
# 2. Use --settings to force the usage of our "settings.xml" file.
3334

3435
if [ $TRAVIS_REPO_SLUG == "mybatis/migrations" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ] && [[ "$commit_message" != *"[maven-release-plugin]"* ]]; then
3536

3637
if [ $TRAVIS_JDK_VERSION == "openjdk8" ]; then
3738

38-
# Deploy to sonatype
39-
./mvnw clean deploy -q --settings ./travis/settings.xml
40-
echo -e "Successfully deployed SNAPSHOT artifacts to Sonatype under Travis job ${TRAVIS_JOB_NUMBER}"
41-
4239
# Deploy to coveralls
43-
./mvnw clean test jacoco:report coveralls:report -q --settings ./travis/settings.xml
40+
./mvnw clean test jacoco:report coveralls:report -q --settings ./mvn/settings.xml
4441
echo -e "Successfully ran coveralls under Travis job ${TRAVIS_JOB_NUMBER}"
4542

4643
# Deploy to site
4744
# Cannot currently run site this way
48-
# ./mvnw site site:deploy -q --settings ./travis/settings.xml
49-
# echo -e "Successfully deploy site under Travis job ${TRAVIS_JOB_NUMBER}"
45+
# ./mvnw site site:deploy -q --settings ./mvn/settings.xml
46+
# echo -e "Successfully deploy site under Travis job ${TRAVIS_JOB_NUMBER}"
5047
else
5148
echo "Java Version does not support additonal activity for travis CI"
5249
fi

travis/settings.xml

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)