generated from o7-Fire/Mindustry-Mods-Template
-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (57 loc) · 1.85 KB
/
test.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
name: Sonar Gradle Test
on:
workflow_run:
workflows: [ "Java CI" ]
branches: [ main ]
types:
- completed
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
jobs:
Gradle-Test-Sonar:
runs-on: ubuntu-latest
steps:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Gradle Validation
uses: gradle/[email protected]
- name: Set up JDK 16
uses: actions/setup-java@v1
with:
java-version: 16
#when you don't
- name: Change wrapper permissions
run: chmod +x ./gradlew
# Cache Gradle dependencies
- name: Setup Gradle Dependencies Cache
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }}
# Cache Gradle Wrapper
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v2
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
- name: Gradle Test Coverage
uses: GabrielBB/xvfb-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_ORGANIZATION: ${{ secrets.SONAR_ORGANIZATION }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
with:
run: ./gradlew clean download copyMods test -PgithubRepo="$GITHUB_REPOSITORY" --info --scan --continue
- name: Download mindustry
run: |
chmod +x ./downloadMindustryForTest.sh
./downloadMindustryForTest.sh
- name: Run headless test
run: |
chmod +x ./runTest.sh
./runTest.sh