Split master workflow into test and publish stages #3
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: master | |
| on: | |
| push: | |
| paths-ignore: | |
| - 'docs/**' | |
| - '*.md' | |
| branches: | |
| - master | |
| concurrency: | |
| group: '${{ github.workflow }}' | |
| # don't leave snapshot builds in a half-done state | |
| cancel-in-progress: false | |
| jobs: | |
| validate-api: | |
| name: Validate API | |
| if: github.repository == 'serpro69/kotlin-faker' | |
| uses: ./.github/workflows/run_gradle.yml | |
| secrets: inherit | |
| with: | |
| runs-on: ubuntu-latest | |
| ref: master | |
| task: apiCheck | |
| test: | |
| name: Run tests | |
| needs: validate-api | |
| uses: ./.github/workflows/run_gradle.yml | |
| secrets: inherit | |
| with: | |
| runs-on: ubuntu-latest | |
| ref: master | |
| task: > | |
| -P"kotlinFaker_enableKotlinJs=true" | |
| -P"kotlinFaker_enableKotlinNative=true" | |
| check | |
| publish: | |
| name: Publish snapshots | |
| needs: test | |
| strategy: | |
| matrix: | |
| include: | |
| # KMP | |
| - os: ubuntu-latest | |
| args: -P"kotlinFaker_enabledPublicationNamePrefixes=KotlinMultiplatform" | |
| # JVM | |
| - os: ubuntu-latest | |
| args: -P"kotlinFaker_enabledPublicationNamePrefixes=jvm" | |
| uses: ./.github/workflows/run_gradle.yml | |
| secrets: inherit | |
| with: | |
| ref: master | |
| task: > | |
| -P"kotlinFaker_enableKotlinJs=true" | |
| -P"kotlinFaker_enableKotlinNative=true" | |
| ${{ matrix.args }} | |
| --no-configuration-cache | |
| publishToAppropriateCentralRepository | |
| runs-on: ${{ matrix.os }} |