Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 127 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: Check

on:
workflow_dispatch:
workflow_call:

concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}

env:
GRADLE_OPTS: "-Dorg.gradle.daemon=true"

jobs:
lint:
name: Lint the code
runs-on: ubuntu-latest
env:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
steps:
- uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 11

- name: Restore Gradle cache
id: cache-gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.gradle/yarn
~/.gradle/nodejs
~/.konan
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-

- name: Run detekt
run: ./gradlew detektAll

- name: Make artifact location URIs relative
if: ${{ always() }}
continue-on-error: true
run: |
ls '${{ github.workspace }}/build/reports/detekt/'
cp '${{ github.workspace }}/build/reports/detekt/detekt.sarif' '${{ github.workspace }}/detekt.sarif.json'
echo "$(
jq --arg github_workspace ${{ github.workspace }} \
'. | ( .runs[].results[].locations[].physicalLocation.artifactLocation.uri |= if test($github_workspace) then .[($github_workspace | length | . + 1):] else . end )' \
'${{ github.workspace }}/detekt.sarif.json'
)" > '${{ github.workspace }}/detekt.sarif.json'

- uses: github/codeql-action/upload-sarif@v2
if: ${{ always() }}
with:
sarif_file: ${{ github.workspace }}/detekt.sarif.json
checkout_path: ${{ github.workspace }}

check:
name: Check on ${{ matrix.os.runner }}
runs-on: ${{ matrix.os.runner }}
defaults:
run:
shell: ${{ matrix.os.shell }}
strategy:
fail-fast: false
matrix:
os:
- runner: macos-latest
shell: bash
separator: '/'
- runner: ubuntu-latest
shell: bash
separator: '/'
- runner: windows-latest
shell: msys2 {0}
separator: '\'
steps:
- uses: msys2/setup-msys2@v2
if: ${{ runner.os == 'Windows' }}
with:
release: false
msystem: MINGW64
path-type: inherit
update: true
install: >-
curl
mingw-w64-x86_64-curl

- uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 11

- name: Restore Gradle cache
id: cache-gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.gradle/yarn
~/.gradle/nodejs
~/.konan
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-

- name: Gradle Compile
run: ./gradlew compile assemble --scan

- name: Gradle Check
run: ./gradlew check -x detekt -x detektAll --scan

- name: Gradle Test Local Publishing
run: ./gradlew publishToLocal --scan

- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: reports-${{ runner.os }}
path: |
**${{ matrix.os.separator }}build${{ matrix.os.separator }}reports
13 changes: 13 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: PR

on:
pull_request:
branches:
- master

env:
GRADLE_OPTS: "-Dorg.gradle.daemon=true"

jobs:
check:
uses: ./.github/workflows/check.yml
24 changes: 0 additions & 24 deletions .github/workflows/publish_release.yml

This file was deleted.

103 changes: 0 additions & 103 deletions .github/workflows/publish_snapshot.yml

This file was deleted.

68 changes: 0 additions & 68 deletions .github/workflows/pull_request.yml

This file was deleted.

Loading