From 7920c6c6f55e75698e42187d13b69f49279dd57b Mon Sep 17 00:00:00 2001 From: Brian Norman Date: Sun, 11 Sep 2022 11:07:14 -0500 Subject: [PATCH 1/3] Update GitHub workflows --- .github/workflows/build.yml | 68 ++++++++++++++++++++++++++++++++++++ .github/workflows/gradle.yml | 20 ----------- .github/workflows/lint.yml | 16 --------- 3 files changed, 68 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/gradle.yml delete mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000000..e6de7604640 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,68 @@ +name: build + +on: [push, pull_request] + +env: + GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false" + +jobs: + validation: + name: "Validation" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: gradle/wrapper-validation-action@v1 + + lint: + name: "Lint" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Run ktlint + uses: ScaCap/action-ktlint@1.4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + reporter: github-pr-check + + qodana: + name: "Qodana" + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: 'Qodana Scan' + uses: JetBrains/qodana-action@v2022.2.1 + - uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json + + build: + name: "Build" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Configure JDK + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 11 + + - name: Build Project + uses: gradle/gradle-build-action@v2 + with: + arguments: build + + - name: Build Sample + uses: gradle/gradle-build-action@v2 + with: + arguments: build + build-root-directory: sample + + - name: Publish Test Report + if: success() || failure() + uses: mikepenz/action-junit-report@v3 + with: + report_paths: '**/build/test-results/test/TEST-*.xml' diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml deleted file mode 100644 index d0d22f7caee..00000000000 --- a/.github/workflows/gradle.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Project Build - -on: [push, pull_request] - -env: - GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false" - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - uses: gradle/wrapper-validation-action@v1 - - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - - run: ./gradlew build - - run: cd sample && ./gradlew build diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index fb6e0d53220..00000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: lint - -on: [pull_request] - -jobs: - ktlint: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Run ktlint - uses: ScaCap/action-ktlint@1.4 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - reporter: github-pr-check From 5fd863d217c4f3c41531c340d5c44b969a62eb80 Mon Sep 17 00:00:00 2001 From: Brian Norman Date: Sun, 11 Sep 2022 12:25:50 -0500 Subject: [PATCH 2/3] Init qodana and limit PR workflow jobs --- .github/workflows/build.yml | 7 ++++++- qodana.yaml | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 qodana.yaml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e6de7604640..8a5958389d6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,11 @@ name: build -on: [push, pull_request] +on: + push: + branches: + - master + pull_request: + types: [opened, labeled, unlabeled, synchronize] env: GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false" diff --git a/qodana.yaml b/qodana.yaml new file mode 100644 index 00000000000..df8d7f4fa7b --- /dev/null +++ b/qodana.yaml @@ -0,0 +1,8 @@ +version: "1.0" +linter: jetbrains/qodana-jvm-community:2022.2 +profile: + name: qodana.recommended +exclude: + - name: All + paths: + - sample From 1133c842ab614205b3f6a8b8f6abf364f68f46e9 Mon Sep 17 00:00:00 2001 From: Brian Norman Date: Sun, 11 Sep 2022 12:40:20 -0500 Subject: [PATCH 3/3] Combine build and validation --- .github/workflows/build.yml | 56 +++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8a5958389d6..71ec8373357 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,13 +11,36 @@ env: GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false" jobs: - validation: - name: "Validation" + build: + name: "Build" runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: gradle/wrapper-validation-action@v1 + - name: Configure JDK + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 11 + + - name: Build Project + uses: gradle/gradle-build-action@v2 + with: + arguments: build + + - name: Build Sample + uses: gradle/gradle-build-action@v2 + with: + arguments: build + build-root-directory: sample + + - name: Publish Test Report + if: success() || failure() + uses: mikepenz/action-junit-report@v3 + with: + report_paths: '**/build/test-results/test/TEST-*.xml' + lint: name: "Lint" runs-on: ubuntu-latest @@ -42,32 +65,3 @@ jobs: - uses: github/codeql-action/upload-sarif@v2 with: sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json - - build: - name: "Build" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Configure JDK - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - - - name: Build Project - uses: gradle/gradle-build-action@v2 - with: - arguments: build - - - name: Build Sample - uses: gradle/gradle-build-action@v2 - with: - arguments: build - build-root-directory: sample - - - name: Publish Test Report - if: success() || failure() - uses: mikepenz/action-junit-report@v3 - with: - report_paths: '**/build/test-results/test/TEST-*.xml'