-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* use arm macos on CI * update versions of actions * minor cleanup * split jvm runs
- Loading branch information
Showing
5 changed files
with
83 additions
and
168 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,38 @@ | ||
name: "Setup Gradle" | ||
description: "Setup konan relocation and gradle caching specific to kotlin MPP" | ||
name: 'Setup Gradle' | ||
description: 'Setup JDK and Gradle' | ||
inputs: | ||
os: | ||
required: true | ||
description: "OS" | ||
default: ${{ matrix.os }} | ||
cache-disabled: | ||
description: When 'true', all caching is disabled. No entries will be written to or read from the cache. | ||
required: false | ||
default: false | ||
description: 'gradle.cache-disabled' | ||
default: 'false' | ||
cache-read-only: | ||
description: | | ||
When 'true', existing entries will be read from the cache but no entries will be written. | ||
By default this value is 'false' for workflows on the GitHub default branch and 'true' for workflows on other branches. | ||
required: false | ||
default: ${{ github.event.repository != null && github.ref_name != github.event.repository.default_branch }} | ||
description: 'gradle.cache-read-only' | ||
default: 'true' | ||
runs: | ||
# noinspection YAMLSchemaValidation | ||
using: "composite" | ||
using: 'composite' | ||
steps: | ||
- if: inputs.os != 'windows-latest' | ||
run: echo "KONAN_DATA_DIR=${HOME}/.gradle/konan" >> $GITHUB_ENV | ||
shell: bash | ||
- if: inputs.os == 'windows-latest' | ||
run: echo "KONAN_DATA_DIR=${USERPROFILE}\.gradle\konan" >> $GITHUB_ENV | ||
shell: bash | ||
- uses: actions/setup-java@v3 | ||
# On Windows/Linux runners temurin JDK 8, 11, 17, 21 are cached | ||
# On macOS arm64 runners temurin JDK 11, 17, 21 are cached; temurin JDK 8 is not available to download | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: ${{ (runner.os == 'macOS' && runner.arch == 'ARM64') && 'zulu' || 'temurin' }} | ||
java-version: 8 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
# the latest listed version will be used for executions of Gradle | ||
java-version: | | ||
8 | ||
11 | ||
17 | ||
21 | ||
- name: Setup gradle | ||
uses: gradle/gradle-build-action@v2 | ||
- uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
build-scan-publish: true | ||
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service" | ||
build-scan-terms-of-use-agree: "yes" | ||
|
||
validate-wrappers: true | ||
|
||
cache-disabled: ${{ inputs.cache-disabled }} | ||
cache-read-only: ${{ inputs.cache-read-only }} | ||
gradle-home-cache-includes: | | ||
caches | ||
notifications | ||
konan | ||
nodejs | ||
yarn | ||
|
||
gradle-home-cache-cleanup: true |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,123 +1,73 @@ | ||
name: Run tests on all platforms | ||
on: [ workflow_call, workflow_dispatch ] | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
jvm-test: | ||
name: Run JVM tests | ||
runs-on: ubuntu-latest | ||
build-project: | ||
name: Build project on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ 'ubuntu-latest', 'macos-14', 'windows-latest' ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/setup-gradle | ||
- name: Run tests | ||
timeout-minutes: 15 | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: | | ||
jvmTest | ||
jvm11Test | ||
jvm17Test | ||
jvm21Test | ||
--scan | ||
--info | ||
--continue | ||
- if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-reports | ||
path: "**/build/test-results/*Test/TEST-*.xml" | ||
retention-days: 1 | ||
cache-read-only: ${{ github.ref_name != 'main' }} | ||
|
||
js-test: | ||
name: Run JS tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/setup-gradle | ||
- name: Run tests | ||
timeout-minutes: 15 | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: | | ||
jsNodeTest | ||
jsBrowserTest | ||
--scan | ||
--info | ||
--continue | ||
- if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-reports | ||
path: "**/build/test-results/*Test/TEST-*.xml" | ||
retention-days: 1 | ||
- run: ./gradlew build publishToMavenLocal --continue -Prsocketbuild.skipTests=true | ||
|
||
native-test: | ||
name: Run Native(${{ matrix.target }}) tests | ||
run-tests: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ macos-latest ] | ||
target: [ macosX64, iosX64, tvosX64, watchosX64 ] | ||
os: [ 'ubuntu-latest' ] | ||
target: [ 'jvm', 'jvm11', 'jvm17', 'jvm21', 'js', 'native' ] | ||
include: | ||
- os: ubuntu-latest | ||
target: linuxX64 | ||
- os: windows-latest | ||
target: mingwX64 | ||
- os: 'macos-14' | ||
target: 'macos' | ||
- os: 'macos-14' | ||
target: 'ios' | ||
- os: 'macos-14' | ||
target: 'watchos' | ||
- os: 'macos-14' | ||
target: 'tvos' | ||
- os: 'windows-latest' | ||
target: 'native' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/setup-gradle | ||
- name: Run tests | ||
|
||
- run: ./gradlew ${{ matrix.target }}Test --continue | ||
timeout-minutes: 30 | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: | | ||
${{ matrix.target }}Test | ||
${{ matrix.target }}ReleaseTest | ||
--scan | ||
--info | ||
--continue | ||
- if: always() | ||
uses: actions/upload-artifact@v3 | ||
|
||
- if: always() && !cancelled() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-reports | ||
name: test-reports-${{ matrix.os }}-${{ matrix.target }} | ||
path: "**/build/test-results/*Test/TEST-*.xml" | ||
retention-days: 1 | ||
|
||
publish-test-results: | ||
needs: [ jvm-test, js-test, native-test ] | ||
needs: [ run-tests ] | ||
if: always() | ||
name: Publish test report | ||
runs-on: ubuntu-latest | ||
permissions: | ||
checks: write | ||
pull-requests: write | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: test-reports | ||
pattern: test-reports-* | ||
path: test-reports | ||
merge-multiple: 'true' | ||
- name: Publish Test Report | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
with: | ||
files: test-reports/**/TEST-*.xml | ||
|
||
build-project: | ||
name: Build project on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/setup-gradle | ||
- name: Build project without running tests | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: | | ||
build | ||
publishToMavenLocal | ||
--scan | ||
--info | ||
--continue | ||
-Prsocketbuild.skipTests=true |