Kotlin 2.2.0 configuration cache workaround for wasm/js #447
This file contains hidden or 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: Build | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths-ignore: | |
| - '**.md' | |
| - 'LICENSE' | |
| - '.gitignore' | |
| pull_request: | |
| branches: | |
| - master | |
| paths-ignore: | |
| - '**.md' | |
| - 'LICENSE' | |
| - '.gitignore' | |
| workflow_dispatch: | |
| concurrency: | |
| group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| os: | |
| - macos-latest | |
| - ubuntu-latest | |
| - windows-latest | |
| fail-fast: false | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup JDK 11 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: "temurin" | |
| java-version: "11" | |
| - name: Validate Gradle wrapper | |
| uses: gradle/actions/wrapper-validation@v4 | |
| - name: Cache Kotlin Konan | |
| id: cache-kotlin-konan | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.konan/**/* | |
| key: kotlin-konan-${{ runner.os }} | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| cache-cleanup: always | |
| - name: Build project | |
| run: ./gradlew build --stacktrace | |
| # avoid race conditions for wasm/js builds since Kotlin 2.2.0 | |
| env: | |
| YARN_FLAGS: "--network-concurrency 1 --mutex network" | |
| publish: | |
| # only publish after 'build' was successful, and this workflow is running on master branch | |
| needs: build | |
| if: github.ref == 'refs/heads/master' | |
| uses: ./.github/workflows/publish.yml | |
| secrets: inherit |