Skip to content

Commit

Permalink
Add binary-compat and spotless, update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
DrewCarlson committed Jul 15, 2022
1 parent d50d573 commit 083342f
Show file tree
Hide file tree
Showing 59 changed files with 2,932 additions and 673 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Code Quality

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
file-changes:
runs-on: ubuntu-latest
outputs:
any: ${{ steps.check.outputs.any_changed }}
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0
- name: Get changed files
id: check
uses: tj-actions/changed-files@v23
with:
files: |
.github/workflows/code-quality.yml
gradle/libs.versions.toml
gradle/kotlin-js-store/**
**/*.kt
**/*.kts
spotless:
runs-on: ubuntu-latest
needs: [ file-changes ]
if: needs.file-changes.outputs.any == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11

- name: Cache Build files
uses: actions/cache@v3
with:
path: |
~/.gradle
key: ${{ runner.os }}-${{ hashFiles('gradle.properties') }}

- uses: gradle/gradle-build-action@v2
name: Check spotless/ktlint rules
with:
arguments: spotlessCheck

api-check:
runs-on: ubuntu-latest
needs: [ file-changes ]
if: needs.file-changes.outputs.any == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11

- name: Cache Build files
uses: actions/cache@v3
with:
path: |
~/.gradle
key: ${{ runner.os }}-${{ hashFiles('gradle.properties') }}

- uses: gradle/gradle-build-action@v2
name: Check public api compatibility
with:
arguments: apiCheck
26 changes: 0 additions & 26 deletions .github/workflows/js.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/jvm.yml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/native.yml

This file was deleted.

57 changes: 57 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,81 @@ env:
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEPASSWORD }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEUSERNAME }}
ORG_GRADLE_PROJECT_sonatypeStagingProfile: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPESTAGINGPROFILE }}

jobs:
file-changes:
runs-on: ubuntu-latest
outputs:
any: ${{ steps.check.outputs.any_changed }}
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0
- name: Get changed files
id: check
uses: tj-actions/changed-files@v23
with:
files: |
.github/workflows/publish.yml
gradle/libs.versions.toml
gradle/kotlin-js-store/**
**/*.kt
**/*.kts
publish:
name: Publish to Maven
runs-on: macos-latest
needs: [ file-changes ]
if: needs.file-changes.outputs.any == 'true' || startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11

- name: Cache Build files
uses: actions/cache@v3
with:
path: |
~/.konan
~/.gradle
key: ${{ runner.os }}-${{ hashFiles('gradle.properties') }}

- uses: gradle/gradle-build-action@v2
name: Publish
with:
arguments: clean publish

publish-docs:
name: Publish KDoc to Github Pages
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11

- name: Cache Build files
uses: actions/cache@v3
with:
path: |
~/.konan
~/.gradle
key: ${{ runner.os }}-${{ hashFiles('gradle.properties') }}

- uses: gradle/gradle-build-action@v2
name: Build Docs
with:
arguments: clean dokkaHtmlMultiModule

- name: Publish Docs
uses: JamesIves/[email protected]
with:
branch: docs
folder: build/dokka/html
single-commit: true
102 changes: 102 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
file-changes:
runs-on: ubuntu-latest
outputs:
any: ${{ steps.check.outputs.any_changed }}
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0
- name: Get changed files
id: check
uses: tj-actions/changed-files@v23
with:
files: |
.github/workflows/tests.yml
gradle/libs.versions.toml
gradle/kotlin-js-store/**
**/*.kt
**/*.kts
tests:
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.os }}
needs: [ file-changes ]
if: needs.file-changes.outputs.any == 'true'
steps:
- run: sudo apt-get update --fix-missing && sudo apt-get install libcurl4-openssl-dev
name: Install libcurl-dev
if: ${{ startsWith(matrix.os, 'ubuntu') }}

- run: choco install curl
name: Install curl
if: ${{ startsWith(matrix.os, 'windows') }}

- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11

- name: Cache Build files
uses: actions/cache@v3
with:
path: |
~/.konan
~/.gradle
%USERPROFILE%\.gradle
%USERPROFILE%\.konan
key: ${{ runner.os }}-${{ hashFiles('gradle.properties') }}

- uses: gradle/gradle-build-action@v2
name: Test Apple Targets
if: startsWith(matrix.os, 'macos')
with:
arguments: macosTest # iosTest tvosTest watchosX86Test

- uses: gradle/gradle-build-action@v2
name: Test Jvm Target
if: startsWith(matrix.os, 'ubuntu')
with:
arguments: jvmTest

- uses: gradle/gradle-build-action@v2
name: Test Linux Target
if: startsWith(matrix.os, 'ubuntu')
with:
arguments: linuxX64Test

- uses: gradle/gradle-build-action@v2
name: Test Js Targets
if: startsWith(matrix.os, 'ubuntu')
with:
arguments: jsTest

- uses: gradle/gradle-build-action@v2
name: Test Windows Target
if: startsWith(matrix.os, 'windows')
with:
arguments: win64MainKlibrary

- name: Publish Test Reports
uses: mikepenz/action-junit-report@v3
if: always()
with:
report_paths: 'build/test-results/**/TEST-*.xml'

- name: Archive test reports
uses: actions/upload-artifact@v3
if: always()
with:
name: test-reports
path: build/reports/tests/**/**
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@


![Maven Central](https://img.shields.io/maven-central/v/org.drewcarlson/coingecko-jvm?label=maven&color=blue)
![](https://github.com/DrewCarlson/CoinGecko-Kotlin/workflows/Jvm/badge.svg)
![](https://github.com/DrewCarlson/CoinGecko-Kotlin/workflows/Js/badge.svg)
![](https://github.com/DrewCarlson/CoinGecko-Kotlin/workflows/Native/badge.svg)
![](https://github.com/DrewCarlson/CoinGecko-Kotlin/workflows/Tests/badge.svg)

Multiplatform Kotlin wrapper for the [CoinGecko API](https://www.coingecko.com/en/api) using [Ktor](https://ktor.io).

Expand Down
Loading

0 comments on commit 083342f

Please sign in to comment.