Skip to content

Commit 2fca192

Browse files
committed
ci upgrade
1 parent cdc1904 commit 2fca192

File tree

11 files changed

+3618
-2989
lines changed

11 files changed

+3618
-2989
lines changed

.github/workflows/check.yml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: Check
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_call:
6+
7+
concurrency:
8+
cancel-in-progress: true
9+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
10+
11+
env:
12+
GRADLE_OPTS: "-Dorg.gradle.daemon=true"
13+
14+
jobs:
15+
lint:
16+
name: Lint the code
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
21+
- uses: actions/setup-java@v3
22+
with:
23+
distribution: 'adopt'
24+
java-version: 11
25+
26+
- name: Restore Gradle cache
27+
id: cache-gradle
28+
uses: actions/cache@v3
29+
with:
30+
path: |
31+
~/.gradle/caches
32+
~/.gradle/wrapper
33+
~/.gradle/yarn
34+
~/.gradle/nodejs
35+
~/.konan
36+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
37+
restore-keys: ${{ runner.os }}-gradle-
38+
39+
- name: Run detekt
40+
run: ./gradlew detektAll
41+
42+
- name: Make artifact location URIs relative
43+
if: ${{ always() }}
44+
continue-on-error: true
45+
run: |
46+
ls '${{ github.workspace }}/build/reports/detekt/'
47+
cp '${{ github.workspace }}/build/reports/detekt/detekt.sarif' '${{ github.workspace }}/detekt.sarif.json'
48+
echo "$(
49+
jq --arg github_workspace ${{ github.workspace }} \
50+
'. | ( .runs[].results[].locations[].physicalLocation.artifactLocation.uri |= if test($github_workspace) then .[($github_workspace | length | . + 1):] else . end )' \
51+
'${{ github.workspace }}/detekt.sarif.json'
52+
)" > '${{ github.workspace }}/detekt.sarif.json'
53+
54+
- uses: github/codeql-action/upload-sarif@v2
55+
if: ${{ always() }}
56+
with:
57+
sarif_file: ${{ github.workspace }}/detekt.sarif.json
58+
checkout_path: ${{ github.workspace }}
59+
60+
check:
61+
name: Check on ${{ matrix.os.runner }}
62+
runs-on: ${{ matrix.os.runner }}
63+
defaults:
64+
run:
65+
shell: ${{ matrix.os.shell }}
66+
strategy:
67+
fail-fast: false
68+
matrix:
69+
os:
70+
- runner: macos-latest
71+
shell: bash
72+
separator: '/'
73+
- runner: ubuntu-latest
74+
shell: bash
75+
separator: '/'
76+
- runner: windows-latest
77+
shell: msys2 {0}
78+
separator: '\'
79+
steps:
80+
- uses: msys2/setup-msys2@v2
81+
if: ${{ runner.os == 'Windows' }}
82+
with:
83+
release: false
84+
msystem: MINGW64
85+
path-type: inherit
86+
update: true
87+
install: >-
88+
curl
89+
mingw-w64-x86_64-curl
90+
91+
- uses: actions/checkout@v3
92+
93+
- uses: actions/setup-java@v3
94+
with:
95+
distribution: 'adopt'
96+
java-version: 11
97+
98+
- name: Restore Gradle cache
99+
id: cache-gradle
100+
uses: actions/cache@v3
101+
with:
102+
path: |
103+
~/.gradle/caches
104+
~/.gradle/wrapper
105+
~/.gradle/yarn
106+
~/.gradle/nodejs
107+
~/.konan
108+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
109+
restore-keys: ${{ runner.os }}-gradle-
110+
111+
- name: Gradle Compile
112+
run: ./gradlew compile assemble --scan
113+
114+
- name: Gradle Check
115+
run: ./gradlew check -x detekt -x detektAll --scan
116+
117+
- name: Gradle Test Local Publishing
118+
run: ./gradlew publishToLocal --scan
119+
120+
- uses: actions/upload-artifact@v3
121+
if: ${{ always() }}
122+
with:
123+
name: reports-${{ runner.os }}
124+
path: |
125+
**${{ matrix.os.separator }}build${{ matrix.os.separator }}reports

.github/workflows/pr.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: PR
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
env:
9+
GRADLE_OPTS: "-Dorg.gradle.daemon=true"
10+
11+
jobs:
12+
check:
13+
uses: ./.github/workflows/check.yml

.github/workflows/publish_release.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/publish_snapshot.yml

Lines changed: 0 additions & 103 deletions
This file was deleted.

.github/workflows/pull_request.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)