From 00563d1dd2b0cac3b2d2859e76fea7020aabc697 Mon Sep 17 00:00:00 2001 From: Oleg Yukhnevich Date: Tue, 8 Aug 2023 17:27:28 +0300 Subject: [PATCH] test configuration cache --- .github/workflows/build-kotlin-eap.yml | 33 ------------ .github/workflows/run-build.yml | 71 +++++++++++++++++++++++++- 2 files changed, 69 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build-kotlin-eap.yml b/.github/workflows/build-kotlin-eap.yml index 00378cfd..34f91a53 100644 --- a/.github/workflows/build-kotlin-eap.yml +++ b/.github/workflows/build-kotlin-eap.yml @@ -5,39 +5,6 @@ on: - kotlin-eap/* jobs: - build: - name: Kotlin=${{ matrix.kotlin-version }} - strategy: - fail-fast: false - matrix: - kotlin-version: [ '' ] # empty means a current project version - include: - - kotlin-version: '[1.9.20-dev,1.9.20-dev-9999[' - patch-file: './.github/patches/kotlin_1_9_20.patch' - uses: ./.github/workflows/run-build.yml - with: - kotlin-version: ${{ matrix.kotlin-version }} - patch-file: ${{ matrix.patch-file }} - cache-disabled: true - skip-tests: false - - build-k2: - name: Kotlin/K2=${{ matrix.kotlin-version }} - strategy: - fail-fast: false - matrix: - kotlin-version: [ '' ] # empty means a current project version - include: - - kotlin-version: '[1.9.20-dev,1.9.20-dev-9999[' - patch-file: './.github/patches/kotlin_1_9_20.patch' - uses: ./.github/workflows/run-build.yml - with: - kotlin-version: ${{ matrix.kotlin-version }} - patch-file: ${{ matrix.patch-file }} - cache-disabled: true - skip-tests: false - kotlin-use-k2: true - build-cc: name: Kotlin/CC=${{ matrix.kotlin-version }} strategy: diff --git a/.github/workflows/run-build.yml b/.github/workflows/run-build.yml index 3f2f634a..d92d1801 100644 --- a/.github/workflows/run-build.yml +++ b/.github/workflows/run-build.yml @@ -51,7 +51,7 @@ on: default: 'true' jobs: - build: + build-no-tests: runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -81,7 +81,74 @@ jobs: build publishToMavenLocal --continue - -Pskip.test=${{ inputs.skip-tests }} + -Pskip.test=true + -Pkotlin.experimental.tryK2=${{ inputs.kotlin-use-k2 }} + -PuseKotlin=${{ inputs.kotlin-version }} + ${{ steps.configuration-cache.outputs.ARGS }} + + check-no-tests: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ] + steps: + - uses: actions/checkout@v3 + - run: git apply ${{ inputs.patch-file }} + if: inputs.patch-file != '' + - uses: ./.github/actions/setup-gradle + with: + cache-disabled: ${{ inputs.cache-disabled }} + + - id: configuration-cache + if: ${{ inputs.configuration-cache-enabled }} + run: echo "ARGS=--configuration-cache" >> $GITHUB_OUTPUT + + - if: matrix.os == 'windows-latest' + uses: msys2/setup-msys2@v2 + with: + release: false + install: mingw-w64-x86_64-openssl + + - uses: gradle/gradle-build-action@v2 + with: + arguments: | + check + --continue + -Pskip.test=true + -Pkotlin.experimental.tryK2=${{ inputs.kotlin-use-k2 }} + -PuseKotlin=${{ inputs.kotlin-version }} + ${{ steps.configuration-cache.outputs.ARGS }} + + check: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ] + steps: + - uses: actions/checkout@v3 + - run: git apply ${{ inputs.patch-file }} + if: inputs.patch-file != '' + - uses: ./.github/actions/setup-gradle + with: + cache-disabled: ${{ inputs.cache-disabled }} + + - id: configuration-cache + if: ${{ inputs.configuration-cache-enabled }} + run: echo "ARGS=--configuration-cache" >> $GITHUB_OUTPUT + + - if: matrix.os == 'windows-latest' + uses: msys2/setup-msys2@v2 + with: + release: false + install: mingw-w64-x86_64-openssl + + - uses: gradle/gradle-build-action@v2 + with: + arguments: | + check + --continue -Pkotlin.experimental.tryK2=${{ inputs.kotlin-use-k2 }} -PuseKotlin=${{ inputs.kotlin-version }} ${{ steps.configuration-cache.outputs.ARGS }}