-
Notifications
You must be signed in to change notification settings - Fork 23
96 lines (94 loc) · 3.51 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Cukedoctor Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: Cukedoctor Build
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/[email protected]
with:
distribution: 'adopt'
java-version: '11'
- uses: actions/[email protected]
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build
run: mvn install -DskipTests
test:
name: Cukedoctor Test, Coverage & Docs
runs-on: ubuntu-18.04
needs: build
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/[email protected]
with:
distribution: 'adopt'
java-version: '11'
- uses: actions/[email protected]
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Test
run: mvn verify jacoco:report -Pcoverage
- name: Coverage
run: mvn coveralls:report -Pcoverage -DCOVERAGE_TOKEN=${{ secrets.COVERAGE_TOKEN }} -DskipTests
if: "contains(github.ref, 'master')"
- name: Sonar
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: mvn sonar:sonar -Psonar -Dsonar.organization=cukedoctor -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} -Dsonar.scanner.force-deprecated-java-version-grace-period=true
if: "contains(github.ref, 'master')"
- name: Configure Git user
run: |
git config --global user.email "${{ secrets.GIT_EMAIL }}"
git config --global user.name "rmpestano"
- name: Docs
run: cd cukedoctor-converter && mvn -q cukedoctor:execute scm-publish:publish-scm -Pdocs -DGH_TOKEN=${{ secrets.GH_TOKEN }} && cd ../cukedoctor-section-layout && mvn -q cukedoctor:execute scm-publish:publish-scm -DGH_TOKEN=${{ secrets.GH_TOKEN }}
if: "contains(github.ref, 'master')"
release:
name: Release Cukedoctor to maven central
runs-on: ubuntu-18.04
needs: test
env:
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/[email protected]
with:
distribution: 'adopt'
java-version: '11'
server-id: releases
server-username: MAVEN_USER
server-password: MAVEN_PASS
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- uses: actions/[email protected]
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Deploy snapshots
run: mvn deploy -Pfat-jar --settings settings.xml -DskipTests=true -Darguments="-DskipTests -Dmaven.test.skip=true"
if: "contains(github.ref, 'master') && !contains(github.event.head_commit.message, 'prepare release')"
- name: Release
run: mvn deploy -Pfat-jar -Prelease
if: "contains(github.ref, 'master') && contains(github.event.head_commit.message, 'prepare release')"
env:
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}