forked from CUTR-at-USF/gtfs-realtime-validator
-
Notifications
You must be signed in to change notification settings - Fork 10
55 lines (52 loc) · 1.71 KB
/
test_package.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
# This workflow will test and build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Test and Package
on:
push:
branches: [ master ]
paths-ignore:
- '**.md'
pull_request:
branches: [ master ]
paths-ignore:
- '**.md'
release:
types: [ prereleased, released ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Run Java tests
run: mvn --batch-mode --update-snapshots test
- name: Persist Java tests reports
if: always()
uses: actions/upload-artifact@v2
with:
name: Test reports
path: |
gtfs-realtime-validator-lib/target/surefire-reports
gtfs-realtime-validator-webapp/target/surefire-reports
package:
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Deploy to Github Package Registry
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && matrix.os == 'ubuntu-latest'
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn --batch-mode --update-snapshots deploy -DskipTests -DGITHUB_REPOSITORY=$GITHUB_REPOSITORY