-
Notifications
You must be signed in to change notification settings - Fork 3
76 lines (74 loc) · 2.25 KB
/
compile_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
66
67
68
69
70
71
72
73
74
75
76
name: Compile, analyze, and test pulumi-kotlin
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
compile-and-test:
name: Compile and test pulumi-kotlin
runs-on: ubuntu-latest
steps:
- name: Check out project sources
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 21
- name: Compile and test code
id: run-tests
run: ./gradlew build test -x check
- name: Upload buildSrc test report
if: ${{ failure() && steps.run-tests.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: build-src-test-report
path: ./buildSrc/build/reports/tests/test/*
retention-days: 3
- name: Upload test report
if: ${{ failure() && steps.run-tests.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: test-report
path: ./build/reports/tests/test/*
retention-days: 3
- name: Upload ejected-tests
if: ${{ failure() && steps.run-tests.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: ejected-tests
path: ./ejected-tests/
retention-days: 3
analyze:
name: Analyze pulumi-kotlin
runs-on: ubuntu-latest
steps:
- name: Check out project sources
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 21
- name: Run Ktlint
id: run-ktlint
run: ./gradlew lintKotlin
- name: Upload Ktlint report
if: ${{ failure() && steps.run-ktlint.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: ktlint-report
path: ./build/reports/ktlint/*.html
retention-days: 3
- name: Run Detekt
id: run-detekt
run: ./gradlew detekt
- name: Upload Detekt report
if: ${{ failure() && steps.run-detekt.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: detekt-report
path: ./build/reports/detekt/*.html
retention-days: 3