Enable macArm64 CI testing (#501) #267
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
name: Publish | |
on: | |
push: | |
paths-ignore: | |
- 'docs/**' | |
- '*.md' | |
branches: | |
- master | |
- '4.0' | |
jobs: | |
test: | |
if: github.repository == 'ajalt/clikt' | |
strategy: | |
matrix: | |
os: [ macos-latest, macos-14, windows-latest, ubuntu-latest ] | |
include: | |
- os: macos-latest | |
TEST_TASK: macosX64Test | |
- os: macos-14 | |
TEST_TASK: macosArm64Test | |
- os: windows-latest | |
TEST_TASK: mingwX64Test | |
- os: ubuntu-latest | |
TEST_TASK: check | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache Kotlin Native Compiler | |
uses: actions/cache@v3 | |
with: | |
path: ~/.konan | |
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*') }} | |
restore-keys: ${{ runner.os }}-konan- | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: ${{matrix.TEST_TASK}} --stacktrace | |
- name: Bundle the build report | |
if: failure() | |
run: find . -type d -name 'reports' | zip -@ -r build-reports.zip | |
- name: Upload the build report | |
if: failure() | |
uses: actions/upload-artifact@master | |
with: | |
name: error-report | |
path: build-reports.zip | |
deploy: | |
needs: test | |
runs-on: macos-latest | |
if: github.repository == 'ajalt/clikt' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Fetch git tags | |
run: git fetch origin +refs/tags/*:refs/tags/* | |
- name: Cache Kotlin Native Compiler | |
uses: actions/cache@v3 | |
with: | |
path: ~/.konan | |
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*') }} | |
restore-keys: ${{ runner.os }}-konan- | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: | | |
:clikt:assemble | |
:clikt:publish | |
--stacktrace -PinferVersion=true | |
env: | |
# configureondemand=false to work around KT-51763 | |
GRADLE_OPTS: -Dorg.gradle.configureondemand=false -Dorg.gradle.parallel=true -Dkotlin.incremental=false -Dorg.gradle.project.kotlin.incremental.multiplatform=false -Dorg.gradle.project.kotlin.native.disableCompilerDaemon=true -Dorg.gradle.jvmargs="-Xmx5g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8" | |
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralPassword }} | |
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKey }} | |
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralUsername }} |