Skip to content

Commit

Permalink
IMprove github for main
Browse files Browse the repository at this point in the history
  • Loading branch information
alorma committed Feb 6, 2024
1 parent 0568bee commit ac8c302
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 5 deletions.
104 changes: 100 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ on:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{github.job}}
cancel-in-progress: true

jobs:
build:
name: Build
build-dev:
name: Build debug
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
Expand All @@ -28,6 +32,98 @@ jobs:
~/.gradle/wrapper
key: ${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}

# Builds the debug artifacts of the library
- name: Release build
run: ./gradlew :app:bundleDebug
build-release:
name: Build release
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 17
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}

# Builds the release artifacts of the library
- name: Release build
run: ./gradlew build
run: ./gradlew :app:bundleRelease
java-checks:
needs: [ build-dev, build-release ]
runs-on: size/big
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 17
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}

- name: Checkstyle
run: ./gradlew checkstyle

- name: Pmd
run: ./gradlew pmd

ktlint:
needs: [ build-dev, build-release ]
runs-on: size/big
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 17
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}

- name: KtLint
run: ./gradlew ktlintCheck
# Run ktlintCheck on all modules is only executed on app

lint:
needs: [ build-dev, build-release ]
runs-on: size/big
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 17
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}

- name: Lint
run: ./gradlew :app:lintRelease
# Run lint on app (runs on all modules) in order to generate a single report instead of a report per module
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
Expand Down

0 comments on commit ac8c302

Please sign in to comment.