-
-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (60 loc) · 1.75 KB
/
build-and-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
name: Pull Request
on:
pull_request:
branches: [ "main" ]
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
detekt:
name: Detekt review
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
with:
fetch-depth: 1
ref: ${{ github.head_ref }}
- name: Detekt PR Check
uses: alaegin/[email protected]
with:
reviewdog_reporter: github-pr-check
github_token: ${{ secrets.github_token }}
fail_on_error: true
detekt_config: internal/detekt-config.yml
buildtestanalyze:
name: Build, test and analyze
runs-on: ubuntu-latest
timeout-minutes: 120
permissions: # needed for CodeQL steps
security-events: write
packages: read
actions: read
contents: read
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Initialize CodeQL # CodeQL init should happen before project build!
uses: github/codeql-action/init@v3
with:
languages: java-kotlin
build-mode: manual
- name: Set up JDK 17
uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: '17'
cache: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build and test
run: ./gradlew build
- name: Perform CodeQL Analysis # CodeQL analysis needs project build!
uses: github/codeql-action/analyze@v3
with:
category: "/language:java-kotlin"
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: app
path: app/build/outputs/apk/