From 7fada4b1964f5682b928d539a547cf43ecfb819b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojtek=20Kalici=C5=84ski?= <146713236+wkal-pubnub@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:09:33 +0100 Subject: [PATCH] Switch runner to MacOS for testing/publishing KMP artifacts (#296) * Switch runner to `macos-gh` --------- Co-authored-by: Serhii Mamontov --- .github/workflows/release.yml | 14 ++++++++++++-- .github/workflows/run-tests.yml | 23 +++++++++++++++++++---- .github/workflows/run-validations.yml | 11 ++++++++--- settings.gradle.kts | 4 ++++ 4 files changed, 43 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9be6a5f7c..b95148b64 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,10 +10,15 @@ jobs: name: Check release required if: github.event.pull_request.merged && endsWith(github.repository, '-private') != true runs-on: - group: organization/Default + group: macos-gh outputs: release: ${{ steps.check.outputs.ready }} steps: + - name: Install JDK + uses: actions/setup-java@v4 + with: + distribution: 'zulu' # See 'Supported distributions' for available options + java-version: '21' - name: Checkout actions uses: actions/checkout@v4 with: @@ -31,8 +36,13 @@ jobs: needs: check-release if: needs.check-release.outputs.release == 'true' runs-on: - group: organization/Default + group: macos-gh steps: + - name: Install JDK + uses: actions/setup-java@v4 + with: + distribution: 'zulu' # See 'Supported distributions' for available options + java-version: '21' - name: Checkout repository uses: actions/checkout@v4 with: diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 971aa452f..6c1774612 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -8,8 +8,13 @@ jobs: tests: name: Integration and Unit tests runs-on: - group: organization/Default + group: macos-gh steps: + - name: Install JDK + uses: actions/setup-java@v4 + with: + distribution: "zulu" # See 'Supported distributions' for available options + java-version: "21" - name: Checkout repository uses: actions/checkout@v4 - name: Checkout actions @@ -43,7 +48,7 @@ jobs: acceptance-tests: name: Acceptance tests runs-on: - group: organization/Default + group: macos-gh env: pubKey: somePubKey subKey: someSubKey @@ -53,6 +58,15 @@ jobs: serverHostPort: "localhost:8090" serverMock: true steps: + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: latest + - name: Install JDK + uses: actions/setup-java@v4 + with: + distribution: "zulu" # See 'Supported distributions' for available options + java-version: "21" - name: Checkout project uses: actions/checkout@v4 - name: Checkout mock-server action @@ -77,7 +91,8 @@ jobs: ${{ runner.os }}-gradle- - name: Run acceptance tests (optional) run: | - ln -s /home/runner/work/kotlin/kotlin/sdk-specifications pubnub-kotlin-core/core-impl/src/test/resources/sdk-specifications + pwd + ln -s /Users/github/actions-runner/_work/kotlin/kotlin/sdk-specifications pubnub-kotlin/pubnub-kotlin-impl/src/test/resources/sdk-specifications ./gradlew cucumber --tests RunBetaCucumberTest -Dcucumber.features="../../sdk-specifications/features/" -i continue-on-error: true - name: Run acceptance tests (required) @@ -96,7 +111,7 @@ jobs: name: Tests needs: [tests, acceptance-tests] runs-on: - group: organization/Default + group: macos-gh steps: - name: Tests summary run: echo -e "\033[38;2;95;215;0m\033[1mAll tests successfully passed" diff --git a/.github/workflows/run-validations.yml b/.github/workflows/run-validations.yml index 619388298..c0ec1c645 100644 --- a/.github/workflows/run-validations.yml +++ b/.github/workflows/run-validations.yml @@ -14,7 +14,7 @@ jobs: pubnub-yml: name: "Validate .pubnub.yml" runs-on: - group: organization/Default + group: macos-gh steps: - name: Checkout project uses: actions/checkout@v4 @@ -35,8 +35,13 @@ jobs: build-validation: name: Validate build runs-on: - group: organization/Default + group: macos-gh steps: + - name: Install JDK + uses: actions/setup-java@v4 + with: + distribution: "zulu" # See 'Supported distributions' for available options + java-version: "21" - name: Checkout repository uses: actions/checkout@v4 - name: Cache @@ -57,7 +62,7 @@ jobs: name: Validations needs: [pubnub-yml, build-validation] runs-on: - group: organization/Default + group: macos-gh steps: - name: Validations summary run: echo -e "\033[38;2;95;215;0m\033[1mAll validations passed" diff --git a/settings.gradle.kts b/settings.gradle.kts index c203b3c15..2f9b5ecba 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -6,6 +6,10 @@ pluginManagement { } } +plugins { + id("org.gradle.toolchains.foojay-resolver-convention") version("0.8.0") +} + dependencyResolutionManagement { repositories { mavenCentral()