-
Notifications
You must be signed in to change notification settings - Fork 12
50 lines (45 loc) · 1.51 KB
/
javalib.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
name: Java Lib CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
env:
# Needed to get some information about the pull request, if any
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# SonarCloud access token should be generated from https://sonarcloud.io/account/security/
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
steps:
- uses: actions/checkout@v1
- name: set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Dummy gradle.properties
shell: bash
run: |
mkdir -p ~/.gradle/
echo "GRADLE_USER_HOME=$HOME/.gradle" >> $GITHUB_ENV
echo ossrhUsername=dummy > ~/.gradle/gradle.properties
echo ossrhPassword=dummy >> ~/.gradle/gradle.properties
- name: Build with Gradle
run: ./gradlew assemble
- name: Run unit tests
run: ./gradlew test
- name: Upload Test Results
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: Test output
path: /home/runner/work/OpeningHoursParser/OpeningHoursParser/build/reports/tests/test/
- name: Run coverage gen
run: ./gradlew jacocoTestReport
- name: SonarCloud Scan
# only do this step if we have a token for sonar
if: ${{ env.SONAR_TOKEN }}
run: ./gradlew sonarqube -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=simonpoole-github --info