-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
61 additions
and
49 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,18 @@ permissions: | |
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- cmd: "./gradlew :kmp-webrtc:testDebugUnitTest" | ||
os: macos-latest | ||
- cmd: "./gradlew :example:androidApp:assembleDebug" | ||
os: macos-latest | ||
- cmd: "./gradlew :kmp-webrtc:podspec && cd example/iosApp && xcodegen && pod install && xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -sdk iphonesimulator -configuration Debug" | ||
os: macos-latest | ||
dep: "brew update && brew install cocoapods xcodegen" | ||
runs-on: ${{ matrix.os }} | ||
permissions: | ||
pull-requests: write | ||
contents: write | ||
|
@@ -30,51 +41,19 @@ jobs: | |
distribution: "temurin" | ||
cache: "gradle" | ||
- uses: gradle/actions/setup-gradle@v3 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 14 | ||
- name: Setup Test Env | ||
run: | | ||
cd kmp-socketio/src/jvmTest/resources/ | ||
npm install | ||
- name: Run Jvm tests | ||
- uses: suisei-cn/[email protected] | ||
id: download_libs # Remember to give an ID if you need the output filename | ||
name: Download libs.zip | ||
with: | ||
url: "https://github.com/HackWebRTC/kmp-webrtc/releases/latest/download/libs.zip" | ||
target: ./ | ||
- if: ${{ matrix.dep }} | ||
run: ${{ matrix.dep }} | ||
- name: Extract libs | ||
run: | | ||
./gradlew :kmp-socketio:jvmTest --info | ||
- name: Gen coverage | ||
run: | | ||
./gradlew koverXmlReport | ||
- name: Add coverage to PR | ||
id: jacoco | ||
uses: madrapps/[email protected] | ||
with: | ||
paths: ${{ github.workspace }}/kmp-socketio/build/reports/kover/report.xml | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
min-coverage-overall: 80 | ||
min-coverage-changed-files: 80 | ||
pass-emoji: ":white_check_mark:" | ||
fail-emoji: ":negative_squared_cross_mark:" | ||
- name: Overall coverage check | ||
if: ${{ steps.jacoco.outputs.coverage-overall < 80 || steps.jacoco.outputs.coverage-changed-files < 80 }} | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
core.setFailed("Coverage check failed! overall ${{ steps.jacoco.outputs.coverage-overall }}, diff ${{ steps.jacoco.outputs.coverage-changed-files }}.") | ||
- name: Create coverage summary json | ||
uses: jsdaniell/[email protected] | ||
with: | ||
dir: kmp-socketio/build/reports/kover/ | ||
name: "coverage.json" | ||
json: '{"total":{"instructions":{"pct":${{ steps.jacoco.outputs.coverage-overall }} }}}' | ||
- name: Create Coverage Badges | ||
uses: jaywcjlove/coverage-badges-cli@main | ||
with: | ||
source: ${{ github.workspace }}/kmp-socketio/build/reports/kover/coverage.json | ||
output: dist/badges.svg | ||
jsonPath: total.instructions.pct | ||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v4 | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
with: | ||
commit_message: ${{ github.event.head_commit.message }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./dist | ||
unzip -o libs.zip | ||
- if: ${{ matrix.os == 'windows-latest' }} | ||
shell: cmd | ||
run: ${{ matrix.cmd }} | ||
- if: ${{ matrix.os != 'windows-latest' }} | ||
run: ${{ matrix.cmd }} |
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