forked from HSLdevcom/OpenTripPlanner
-
Notifications
You must be signed in to change notification settings - Fork 4
59 lines (56 loc) · 2.07 KB
/
cibuild.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
name: OTP CI Build
# On [push, pull_request] causes double-builds when creating PRs.
# But triggering on push only will miss pull requests from outside authors.
# The push event's ref is the name of the pushed branch;
# The pull_request event's branch name is the merge target branch.
on:
push:
branches:
- master
- dev-1.x
- dev-2.x
pull_request:
branches:
- master
- dev-1.x
- dev-2.x
jobs:
build:
runs-on: ubuntu-latest
steps:
# Starting in v2.2 checkout action fetches all tags when fetch-depth=0, for auto-versioning.
- uses: actions/[email protected]
with:
fetch-depth: 0
# Java setup step completes very fast, no need to run in a preconfigured docker container
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Prepare coverage agent, build and test
run: mvn --batch-mode --update-snapshots jacoco:prepare-agent verify jacoco:report -P prettierCheck
- name: Send coverage data to codecov.io
if: github.repository_owner == 'opentripplanner'
uses: codecov/codecov-action@v2
with:
files: target/site/jacoco/jacoco.xml
- name: Sets env vars for release
if: ${{ github.repository_owner == 'mfdz' && github.ref == 'refs/heads/dev-2.x' }}
run: echo "DOCKER_DATE_TAG=`date +%Y-%m-%d-%H_%M`" >> $GITHUB_ENV
env:
TZ: Europe/Berlin
- name: Publish to Dockerhub
if: ${{ github.repository_owner == 'mfdz' && github.ref == 'refs/heads/dev-2.x' }}
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: mfdz/opentripplanner
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_AUTH}}
tags: "latest,${{ github.sha }},${{ env.DOCKER_DATE_TAG }}"