diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 980b78e2..eaacb8ee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: @@ -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 \ No newline at end of file + 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 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 27fda224..6a30291e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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: