mirror of
https://github.com/fankes/moshi.git
synced 2025-10-18 23:49:21 +08:00
47 lines
1.4 KiB
YAML
47 lines
1.4 KiB
YAML
name: CI
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
build:
|
|
name: 'Kotlin ${{ matrix.kotlin-version }} | Test Mode ${{ matrix.kotlin-test-mode }}'
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
kotlin-test-mode: [ 'REFLECT', 'KSP', 'KAPT' ]
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Validate Gradle Wrapper
|
|
uses: gradle/wrapper-validation-action@v1
|
|
|
|
- name: Generate cache key
|
|
run: ./.github/workflows/checksum.sh checksum.txt
|
|
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: ~/.gradle/caches
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('checksum.txt') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gradle-
|
|
|
|
- name: Configure JDK
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: '17'
|
|
|
|
- name: Test
|
|
run: ./gradlew build check --stacktrace -PkotlinTestMode=${{ matrix.kotlin-test-mode }}
|
|
|
|
- name: Publish (default branch only)
|
|
if: github.repository == 'square/moshi' && github.ref == 'refs/heads/master' && matrix.kotlin-test-mode == 'reflect'
|
|
run: ./gradlew publish
|
|
env:
|
|
ORG_GRADLE_PROJECT_mavenCentralUsername: '${{ secrets.SONATYPE_NEXUS_USERNAME }}'
|
|
ORG_GRADLE_PROJECT_mavenCentralPassword: '${{ secrets.SONATYPE_NEXUS_PASSWORD }}'
|