-
Notifications
You must be signed in to change notification settings - Fork 181
83 lines (79 loc) · 2.77 KB
/
pr.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
name: Pull Request CI
on:
pull_request:
branches:
- 'dev'
merge_group:
# Concurrency strategy:
# github.workflow: distinguish this workflow from others
# github.event_name: distinguish `push` event from `pull_request` and 'merge_group' event
# github.ref_name: distinguish branch
# github.repository: distinguish owner+repository
#
# Reference:
# https://docs.github.com/en/actions/using-jobs/using-concurrency
# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{github.ref_name}}-${{github.repository}}
cancel-in-progress: true
jobs:
validate_gradle_wrapper:
name: "Validate gradle wrapper"
uses: ./.github/workflows/call-validate-gradle-wrapper.yml
check_changelog_changed:
name: "Validate CHANGELOG changed"
uses: ./.github/workflows/call-check-changelog.yml
update_gradle_cache:
name: "Gradle configuration change check"
needs: [ validate_gradle_wrapper ]
uses: ./.github/workflows/call-configuration-change.yml
info:
name: "Display concurrency info"
runs-on: ubuntu-latest
needs: [ validate_gradle_wrapper ]
steps:
- run: |
echo "github.workflow=${{ github.workflow }}"
echo "github.event_name=${{ github.event_name }}"
echo "github.ref_name=${{ github.ref_name }}"
echo "github.repository=${{ github.repository }}"
test:
name: "Run unit tests"
runs-on: ubuntu-latest
needs: [ validate_gradle_wrapper ]
strategy:
matrix:
target: [ "testDebugUnitTest", "desktopTest" ]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
submodules: 'recursive'
- name: Set up JDK 1.17
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4
with:
distribution: 'temurin'
java-version: '17'
- name: "Test ${{ matrix.target }}"
uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3
with:
arguments: ${{ matrix.target }}
detekt:
name: "Check project by linters"
runs-on: ubuntu-latest
needs: [ validate_gradle_wrapper ]
strategy:
matrix:
target: [ "detektMain", "lint" ]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
submodules: 'recursive'
- name: Set up JDK 1.17
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4
with:
distribution: 'temurin'
java-version: '17'
- name: "Lint by ${{ matrix.target }}"
uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3
with:
arguments: ${{ matrix.target }}