Update kotlinx-coroutines monorepo to v1.9.0 #357
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Kotlin Demo Workflow | |
on: | |
pull_request: | |
branches: | |
- master | |
- development | |
types: [opened, synchronize, reopened, ready_for_review] | |
jobs: | |
check-style: | |
name: Check Style | |
runs-on: ubuntu-22.04 | |
if: github.event.pull_request.draft == false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: '11' | |
- name: Generate cache key | |
run: ./checksum.sh checksum.tx | |
- name: Copy CI gradle.properties | |
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: gradle-${{ hashFiles('checksum.txt') }} | |
- name: Run Static Code Analysis | |
run: ./gradlew lintRelease ktlintCheck detekt spotlessCheck --scan | |
- name: (Fail-only) Comment Build Scan Url | |
uses: actions/github-script@v7 | |
if: github.event_name == 'pull_request' && failure() | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
github.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: '❌ ${{ github.workflow }} failed: ${{ steps.gradle.outputs.build-scan-url }}' | |
}) | |
- name: (Fail-only) Bundle the build report | |
if: failure() | |
run: find . -type d -name 'reports' | zip -@ -r build-reports.zip | |
- name: (Fail-only) Upload the build report | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: error-report | |
path: build-reports.zip | |
test: | |
name: Unit Test | |
needs: check-style | |
runs-on: ubuntu-22.04 | |
if: github.event.pull_request.draft == false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: '11' | |
- name: Generate cache key | |
run: ./checksum.sh checksum.tx | |
- name: Copy CI gradle.properties | |
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: gradle-${{ hashFiles('checksum.txt') }} | |
- name: Run Unit Tests | |
run: ./gradlew testReleaseUnitTest | |
- name: Upload Test Results | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: Test Results | |
path: app/build/test-results | |
build: | |
name: Build | |
needs: test | |
runs-on: ubuntu-22.04 | |
if: github.event.pull_request.draft == false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: '11' | |
- name: Generate cache key | |
run: ./checksum.sh checksum.tx | |
- name: Copy CI gradle.properties | |
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: gradle-${{ hashFiles('checksum.txt') }} | |
- name: Asemble Artifact | |
run: ./gradlew assembleRelease | |
- name: Upload Sample Artifacts | |
uses: actions/upload-artifact@v4 | |
if: ${{ github.base_ref }} == 'master' | |
with: | |
name: artifact | |
path: app/build/outputs/apk/ | |
- uses: actions/checkout@master | |
- uses: codecov/codecov-action@v4 | |
with: | |
flags: unittests | |
fail_ci_if_error: true | |
verbose: true | |
- name: Comment Build Scan Url | |
uses: actions/github-script@v7 | |
if: github.event_name == 'pull_request' && failure() | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
github.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: '❌ ${{ github.workflow }} failed: ${{ steps.gradle.outputs.build-scan-url }}' | |
}) |