Skip to content

Extract tests for each platform into separate jobs #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build and test on different host systems

on:
workflow_call:
inputs:
upload-code-coverage:
type: boolean
description: "enabled uploading coverage report to codecov"
required: false
default: false
secrets:
CODECOV_TOKEN:
description: "token to upload codecov report"
required: false
jobs:
check-style:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version-file: .java-version
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Cache konan
uses: actions/cache@v4
with:
path: ~/.konan
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Cache unicode data
uses: actions/cache@v4
with:
path: build/unicode_dump
key: unicode-dump-${{ hashFiles('build/unicode_dump/*') }}
restore-keys: |
unicode-dump-
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper
- name: Build
run: ./gradlew --no-daemon --continue detekt detektAll ktlintCheck apiCheck
check-linux:
uses: ./.github/workflows/check.yml
with:
run-on: ubuntu-latest
task: linuxAllTest
upload-code-coverage: ${{ inputs.upload-code-coverage }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
check-macos:
uses: ./.github/workflows/check.yml
with:
run-on: macos-latest
task: macOsAllTest
check-windows:
uses: ./.github/workflows/check.yml
with:
run-on: windows-latest
task: windowsAllTest
47 changes: 2 additions & 45 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,52 +11,9 @@ concurrency:
cancel-in-progress: true

jobs:
check-style:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version-file: .java-version
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Cache konan
uses: actions/cache@v4
with:
path: ~/.konan
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Cache unicode data
uses: actions/cache@v4
with:
path: build/unicode_dump
key: unicode-dump-${{ hashFiles('build/unicode_dump/*') }}
restore-keys: |
unicode-dump-
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper
- name: Build
run: ./gradlew --no-daemon --continue detekt detektAll ktlintCheck apiCheck
check-linux:
uses: ./.github/workflows/check.yml
check-pr:
uses: ./.github/workflows/build-and-test.yml
with:
run-on: ubuntu-latest
task: linuxAllTest
upload-code-coverage: true
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
check-macos:
uses: ./.github/workflows/check.yml
with:
run-on: macos-latest
task: macOsAllTest
check-windows:
uses: ./.github/workflows/check.yml
with:
run-on: windows-latest
task: windowsAllTest
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ jobs:
version-source: file
version-file: ${{ env.VERSION_FILE }}
version-file-extraction-pattern: ${{ env.VERSION_PATTERN }}
build-and-test:
uses: ./.github/workflows/build-and-test.yml
publish_artifacts:
needs:
- version
- build-and-test
runs-on: macos-latest
steps:
- name: 'Checkout Repository'
Expand Down Expand Up @@ -61,7 +64,7 @@ jobs:
with:
gradle-version: wrapper
- name: Build and publish release
run: ./gradlew --no-daemon --info build publish closeAndReleaseStagingRepository -Pversion=${{ needs.version.outputs.RELEASE_VERSION }} -x :benchmark:benchmark
run: ./gradlew --no-daemon --info :assemble publish closeAndReleaseStagingRepository -Pversion=${{ needs.version.outputs.RELEASE_VERSION }} -x :benchmark:benchmark
env:
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/snapshot_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ on:
- '.github/workflows/benchmark.yml'

jobs:
build-and-test:
uses: ./.github/workflows/build-and-test.yml
with:
upload-code-coverage: true
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
publish:
needs:
- build-and-test
runs-on: macos-latest
steps:
- name: 'Checkout Repository'
Expand Down Expand Up @@ -51,17 +59,12 @@ jobs:
./gradlew
--no-daemon
--info
build publish koverXmlReport
:assemble
publish
-x :benchmark:benchmark
-x :linkDebugTestLinuxX64
-x :test-suites:linkDebugTestLinuxX64
env:
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_SECRET_KEY: ${{ secrets.SIGNING_SECRET_KEY }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
Loading