Skip to content

Commit ba57e9f

Browse files
committed
ci upgrade
1 parent ead065c commit ba57e9f

File tree

5 files changed

+78
-29
lines changed

5 files changed

+78
-29
lines changed

.github/workflows/check.yml

Lines changed: 54 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,59 @@ on:
66

77
concurrency:
88
cancel-in-progress: true
9-
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
9+
group: check-${{ github.workflow }}-${{ github.head_ref || github.ref }}
1010

1111
env:
1212
GRADLE_OPTS: "-Dorg.gradle.daemon=true"
1313

1414
jobs:
15+
lint:
16+
name: Lint the code
17+
runs-on: ubuntu-latest
18+
env:
19+
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
20+
steps:
21+
- uses: actions/checkout@v3
22+
23+
- uses: actions/setup-java@v3
24+
with:
25+
distribution: 'adopt'
26+
java-version: 11
27+
28+
- name: Restore Gradle cache
29+
id: cache-gradle
30+
uses: actions/cache@v3
31+
with:
32+
path: |
33+
~/.gradle/caches
34+
~/.gradle/wrapper
35+
~/.gradle/yarn
36+
~/.gradle/nodejs
37+
~/.konan
38+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
39+
restore-keys: ${{ runner.os }}-gradle-
40+
41+
- name: Run detekt
42+
run: ./gradlew detektAll
43+
44+
- name: Make artifact location URIs relative
45+
if: ${{ always() }}
46+
continue-on-error: true
47+
run: |
48+
ls '${{ github.workspace }}/build/reports/detekt/'
49+
cp '${{ github.workspace }}/build/reports/detekt/detekt.sarif' '${{ github.workspace }}/detekt.sarif.json'
50+
echo "$(
51+
jq --arg github_workspace ${{ github.workspace }} \
52+
'. | ( .runs[].results[].locations[].physicalLocation.artifactLocation.uri |= if test($github_workspace) then .[($github_workspace | length | . + 1):] else . end )' \
53+
'${{ github.workspace }}/detekt.sarif.json'
54+
)" > '${{ github.workspace }}/detekt.sarif.json'
55+
56+
- uses: github/codeql-action/upload-sarif@v2
57+
if: ${{ always() }}
58+
with:
59+
sarif_file: ${{ github.workspace }}/detekt.sarif.json
60+
checkout_path: ${{ github.workspace }}
61+
1562
check:
1663
name: Check on ${{ matrix.os.runner }}
1764
runs-on: ${{ matrix.os.runner }}
@@ -22,12 +69,12 @@ jobs:
2269
fail-fast: false
2370
matrix:
2471
os:
25-
# - runner: macos-latest
26-
# shell: bash
27-
# separator: '/'
2872
- runner: ubuntu-latest
2973
shell: bash
3074
separator: '/'
75+
# - runner: macos-latest
76+
# shell: bash
77+
# separator: '/'
3178
# - runner: windows-latest
3279
# shell: msys2 {0}
3380
# separator: '\'
@@ -67,25 +114,10 @@ jobs:
67114
run: ./gradlew compile assemble --scan
68115

69116
- name: Gradle Check
70-
run: ./gradlew check --scan
117+
run: ./gradlew check -x detekt -x detektAll --scan
71118

72-
- name: Make artifact location URIs relative
73-
if: ${{ always() }}
74-
continue-on-error: true
75-
run: |
76-
ls '${{ github.workspace }}${{ matrix.os.separator }}build${{ matrix.os.separator }}reports${{ matrix.os.separator }}detekt${{ matrix.os.separator }}'
77-
cp '${{ github.workspace }}${{ matrix.os.separator }}build${{ matrix.os.separator }}reports${{ matrix.os.separator }}detekt${{ matrix.os.separator }}detekt.sarif' '${{ github.workspace }}${{ matrix.os.separator }}detekt.sarif.json'
78-
echo "$(
79-
jq --arg github_workspace ${{ github.workspace }} \
80-
'. | ( .runs[].results[].locations[].physicalLocation.artifactLocation.uri |= if test($github_workspace) then .[($github_workspace | length | . + 1):] else . end )' \
81-
'${{ github.workspace }}${{ matrix.os.separator }}detekt.sarif.json'
82-
)" > '${{ github.workspace }}${{ matrix.os.separator }}detekt.sarif.json'
83-
84-
- uses: github/codeql-action/upload-sarif@v2
85-
if: ${{ always() }}
86-
with:
87-
sarif_file: ${{ github.workspace }}${{ matrix.os.separator }}detekt.sarif.json
88-
checkout_path: ${{ github.workspace }}
119+
- name: Gradle Test Local Publishing
120+
run: ./gradlew publishToLocal --scan
89121

90122
- uses: actions/upload-artifact@v3
91123
if: ${{ always() }}

.github/workflows/pr.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
env:
99
GRADLE_OPTS: "-Dorg.gradle.daemon=true"
1010

11+
concurrency:
12+
cancel-in-progress: true
13+
group: pr-${{ github.workflow }}-${{ github.head_ref || github.ref }}
14+
1115
jobs:
1216
check:
1317
uses: ./.github/workflows/check.yml

.github/workflows/release.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Release
22

33
on:
44
push:
5+
paths-ignore:
6+
- '**/*.md'
57
branches:
68
- master
79
workflow_dispatch:
@@ -27,6 +29,10 @@ on:
2729
env:
2830
GRADLE_OPTS: "-Dorg.gradle.daemon=true"
2931

32+
concurrency:
33+
cancel-in-progress: false
34+
group: release-${{ github.workflow }}-${{ github.head_ref || github.ref }}
35+
3036
jobs:
3137
check:
3238
uses: ./.github/workflows/check.yml
@@ -39,7 +45,7 @@ jobs:
3945

4046
build-dokka:
4147
name: Build Dokka
42-
needs:
48+
needs:
4349
- check
4450
- resolve-version
4551
runs-on: ubuntu-latest
@@ -67,7 +73,7 @@ jobs:
6773
restore-keys: ${{ runner.os }}-gradle-
6874

6975
- name: Gradle Assemble Dokka
70-
run: ./gradlew dokkaHtml -Pversion=${VERSION//v} --scan
76+
run: ./gradlew dokkaHtmlMultiModule -Pversion=${VERSION//v} --scan
7177

7278
- uses: actions/upload-artifact@v3
7379
with:
@@ -78,7 +84,7 @@ jobs:
7884
release-Artefacts:
7985
name: Release to ${{ matrix.repository.name }} on ${{ matrix.os.runner }}
8086
runs-on: ${{ matrix.os.runner }}
81-
needs:
87+
needs:
8288
- check
8389
- resolve-version
8490
defaults:
@@ -105,12 +111,12 @@ jobs:
105111
tasks: publishToSonatype closeAndReleaseSonatypeStagingRepository
106112
enabled: ${{ github.event.inputs.skipMavenCentral != 'y' }}
107113
os:
114+
- runner: ubuntu-latest
115+
shell: bash
108116
# - runner: macos-latest
109117
# shell: bash
110118
# - runner: windows-latest
111119
# shell: msys2 {0}
112-
- runner: ubuntu-latest
113-
shell: bash
114120
steps:
115121
- uses: msys2/setup-msys2@v2
116122
if: ${{ matrix.repository.enabled == true && runner.os == 'Windows' }}
@@ -167,7 +173,7 @@ jobs:
167173
run: |
168174
REPO_NAME=${{ github.repository }}
169175
REPO_NAME=${REPO_NAME#${{ github.repository_owner }}/}
170-
cp -avr build/dokka/html/ public;
176+
cp -avr build/dokka/htmlMultiModule/ public;
171177
find public -type f -regex '.*\.\(htm\|html\|txt\|text\|js\|css\)$' -exec gzip -f -k {} \;
172178
echo "/${REPO_NAME} /${REPO_NAME}/${REPO_NAME}/index.html 301" > public/_redirects;
173179
echo "/${REPO_NAME}/index.html /${REPO_NAME}/${REPO_NAME}/index.html 301" >> public/_redirects;

.github/workflows/resolve-version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515

1616
concurrency:
1717
cancel-in-progress: true
18-
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
18+
group: version-${{ github.workflow }}-${{ github.head_ref || github.ref }}
1919

2020
jobs:
2121
resolve:

build-conventions/src/main/kotlin/convention.publishing.gradle.kts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ tasks {
3838
named("clean") {
3939
dependsOn(cleanMavenLocal)
4040
}
41+
register("publishToLocal") {
42+
description = "Publishes all packages to local maven repository at rootDir/build/localMaven"
43+
dependsOn("publishAllPublicationsToLocalRepository")
44+
}
4145
}
4246

4347
signing {
@@ -65,6 +69,9 @@ publishing {
6569
password = System.getenv("GH_PASSWORD")
6670
}
6771
}
72+
maven("file://${rootProject.buildDir}/localMaven") {
73+
name = "Local"
74+
}
6875
}
6976
withType<MavenPublication> {
7077
artifact(tasks["javadocJar"])

0 commit comments

Comments
 (0)