-
-
Notifications
You must be signed in to change notification settings - Fork 123
109 lines (93 loc) · 3.42 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Test
on:
push:
branches:
- main
paths-ignore:
- '*.md'
- '*.asciidoc'
pull_request:
paths-ignore:
- '*.md'
- '*.asciidoc'
workflow_dispatch:
inputs:
reason:
description: 'Reason for manual run'
required: false
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
gradle:
strategy:
matrix:
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
# https://github.com/actions/runner-images/issues/2840
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# defaults are true
android: false
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Checkout the repo
uses: actions/checkout@v4
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Execute buildHealth for main project
id: gradle-buildhealth
run: './gradlew buildHealth'
- name: Execute buildHealth for testkit project
id: gradle-testkit-buildhealth
run: './gradlew -p testkit/ buildHealth'
- name: Execute check (non-functional tests)
id: gradle-test
run: './gradlew check -s -x :functionalTest'
- name: Execute check (testkit)
id: gradle-testkit-check
run: './gradlew -p testkit/ check -s'
- name: Execute JVM functional tests
id: gradle-jvm-check
run: './gradlew :functionalTest -DfuncTest.package=jvm'
- name: Execute Android functional tests
id: gradle-android-check
run: './gradlew :functionalTest -DfuncTest.package=android'
- name: 'Maybe add Build Scan URLs as PR comment'
uses: actions/github-script@v7
if: github.event_name == 'pull_request' && failure()
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `❌ ${{ github.workflow }} workflow failed:
* Root buildHealth : ${{ steps.gradle-buildhealth.outputs.build-scan-url }}
* TestKit buildHealth : ${{ steps.gradle-testkit-buildhealth.outputs.build-scan-url }}
* Non-functional tests : ${{ steps.gradle-test.outputs.build-scan-url }}
* TestKit check : ${{ steps.gradle-testkit-check.outputs.build-scan-url }}
* JVM functional tests : ${{ steps.gradle-jvm-check.outputs.build-scan-url }}
* Android functional tests : ${{ steps.gradle-android-check.outputs.build-scan-url }}
`
})
- name: Publish snapshot
if: github.repository == 'autonomousapps/dependency-analysis-gradle-plugin' && github.ref == 'refs/heads/main'
run: './gradlew :publishToMavenCentral'
env:
sonatypeUsername: ${{ secrets.sonatypeUsername }}
sonatypePassword: ${{ secrets.sonatypePassword }}