-
Notifications
You must be signed in to change notification settings - Fork 25
/
.travis.yml
52 lines (52 loc) · 3.12 KB
/
.travis.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
language: java
install: true
addons:
sonarcloud:
organization: "alfasoftware"
token:
secure: "Rk0cQ9JL2/DB8xrKjaU/m9HEvZllokUZ8c7Q+6g3DHwOsMvZi1OoCdUtDXf9Zl0xtdFPMvoWsGPeZ6+sZK9evHscvRH83hVMTrTabWK4+QL660QeMXboBprwuBIpAI0XBCfNcslsT3zPd/e4v35FHPdvRr1yOQlibrjEgs1MZo6/LQ7QgRNJAHsskiqOOJS6LLDHceYJEW7wd/y7R0BvXoxch6xQhDOFvowoc22/cEyUVCSCMMas74hD//veSXdHt0CNOY+H+/PAzAYsbM0rkJnrysqO8UgLZwpnP/Mjsoi0InoisvriSl9MYgQwMAfcrtVxxR94vt4Pu62LXsnt6ufGfwFBrdTh1Rna05fzTAmm9bwywIR2UsMwNeM4iDoz+Rc2ImnwMKRipn5lib5kCOlwqjTv6NVi0oV5XEzTfU51HIrQMmmsq60YwMZgcYwckHoVVOojv29dAjLe0Z/LbfUH8MHprt8/MdWA8ir2egxHHW3dXVY11MgDKzQ2RyYb1uPNJgkVfZDm7uHDcj13dFR61Gy1mTdrtpnWx1ojU2IJQ4oKuGb04RbqQ5lCq7dgsHlaeaAJFMlcn1I6IOk8t6QkYy/3vhSXgkZpQAO3K5Zp4aaGZD90sYdQO3JQNCe2S8mhgEGOqsAdxytFygCaMxOKG5NV9qxVilkzfGPvmqM="
jdk: openjdk17
dist: xenial
jobs:
include:
# Push to main
- if: repo = alfasoftware/morf AND branch = main AND NOT type = pull_request
name: "Test"
script:
- git fetch --unshallow --quiet
- mvn clean verify sonar:sonar -Pcoverage -B -U
# Push to a non-PR feature branch - we ignore tags to avoid a double build with the deploy step below
- if: repo = alfasoftware/morf AND NOT tag IS present AND NOT branch = main AND NOT type = pull_request
name: "Test"
script:
- git fetch --unshallow --quiet
- mvn clean verify sonar:sonar -Pcoverage -B -U -Dsonar.branch.name=$TRAVIS_BRANCH
# Push to a PR feature branch
- if: repo = alfasoftware/morf AND head_repo = alfasoftware/morf AND type = pull_request
name: "Test"
script:
- git fetch --unshallow --quiet
- mvn clean verify sonar:sonar -Pcoverage -B -U -Dsonar.pullrequest.key=$TRAVIS_PULL_REQUEST -Dsonar.pullrequest.branch=$TRAVIS_PULL_REQUEST_BRANCH -Dsonar.pullrequest.base=$TRAVIS_BRANCH
# Avoid a double build on pushes to main - we shouldn't need to deploy SNAPSHOTS as they are not used.
# - if: repo = alfasoftware/morf AND branch = main AND NOT type = pull_request
# name: "Deploy From Main"
# script:
# - echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --import
# - echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust
# - mvn clean deploy --settings .maven-settings.xml -B -U -Prelease
# Push to a tag from working group members (i.e. a release)
- if: repo = alfasoftware/morf AND tag IS present AND NOT type = pull_request AND sender in (capgen628, gilleain, jsimlo, therealluigi, okeating, wnicholson)
name: "Deploy From Tag"
script:
- echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --import
- echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust
- mvn clean deploy --settings .maven-settings.xml -B -U -Prelease
# Builds from other forks - we can't run sonar on these
- if: (repo = alfasoftware/morf AND NOT head_repo = alfasoftware/morf AND type = pull_request) OR NOT repo = alfasoftware/morf
name: "Test"
script:
- mvn clean test -B -U
cache:
directories:
- '$HOME/.m2/repository'
- '$HOME/.sonar/cache'