-
Notifications
You must be signed in to change notification settings - Fork 4
68 lines (68 loc) · 2.78 KB
/
Copy pathTest.yml
File metadata and controls
68 lines (68 loc) · 2.78 KB
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
# Copyright 2026 Peanut Butter Unicorn LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Test
on:
pull_request:
branches:
- "main"
- "[0-9]+.[0-9]+.[0-9]+" # release branches
jobs:
build-and-analyze:
runs-on: ubuntu-latest
env:
Z4J_URL: ${{ secrets.ZENDESK_URL }}
Z4J_TOKEN: ${{ secrets.ZENDESK_TOKEN }}
Z4J_ADMIN_EMAIL: ${{ secrets.ZENDESK_ADMIN_EMAIL}}
Z4J_AGENT_EMAIL: ${{ secrets.ZENDESK_AGENT_EMAIL}}
Z4J_END_USER_EMAIL: ${{ secrets.ZENDESK_END_USER_EMAIL}}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GITHUB_TOKEN is required for SonarCloud to decorate PRs
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2
with:
fetch-depth: 0 # SonarCloud needs a full history to assign issues correctly
- name: Set up JDK
uses: graalvm/setup-graalvm@60c26726de13f8b90771df4bc1641a52a3159994
with:
java-version: '21'
distribution: 'graalvm-community'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # 6.1.0
- name: Build and run tests
if: ${{ github.event.pull_request.base.ref != 'main' && github.event.action != 'closed' }}
run: ./gradlew build
- name: Sonar Scan
if: ${{ github.event.pull_request.base.ref == 'main' && github.event.action != 'closed' }} # Only run SonarQube on PRs to main
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build sonar
- name: Upload test report
if: failure()
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # 7.0.0
with:
name: test-report
path: build/reports/tests/test
dependency-submission:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2
- name: Set up JDK 21
uses: graalvm/setup-graalvm@60c26726de13f8b90771df4bc1641a52a3159994 # 1.5.2
with:
java-version: '21'
distribution: 'graalvm-community'
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6.1.0