Skip to content

Commit

Permalink
Update semver-ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
z4kn4fein committed May 20, 2022
1 parent 37281ae commit 37b3dfc
Showing 1 changed file with 28 additions and 38 deletions.
66 changes: 28 additions & 38 deletions .github/workflows/semver-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ on:
tags: [ '[0-9]+.[0-9]+.[0-9]+' ]
paths-ignore:
- '**.md'

workflow_dispatch:

jobs:
assemble:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -26,14 +26,9 @@ jobs:
uses: ./.github/actions/cache-konan
- name: Cache Gradle
uses: ./.github/actions/cache-gradle
- name: Run assemble
run: ./gradlew assemble --stacktrace
- name: Run all tests
run: ./gradlew allTests --stacktrace
shell: bash
- name: Upload build folder
uses: actions/upload-artifact@v3
with:
name: build-output
path: build

lint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -76,12 +71,9 @@ jobs:
name: analysis-report
path: build/reports/detekt

test:
needs: [assemble, lint, analysis]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
coverage:
needs: [test, lint, analysis]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK
Expand All @@ -93,18 +85,21 @@ jobs:
uses: ./.github/actions/cache-konan
- name: Cache Gradle
uses: ./.github/actions/cache-gradle
- name: Download build folder
uses: actions/download-artifact@v2
with:
name: build-output
path: build
- name: Run all tests
run: ./gradlew allTests --stacktrace
- name: Calculate coverage
run: ./gradlew koverMergedXmlReport --stacktrace
shell: bash
- name: Upload coverage report
uses: actions/upload-artifact@v3
with:
name: coverage-report
path: build/reports/kover

coverage:
needs: [assemble, lint, analysis]
runs-on: ubuntu-latest
assemble:
needs: [ test, lint, analysis ]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@v3
- name: Set up JDK
Expand All @@ -116,17 +111,12 @@ jobs:
uses: ./.github/actions/cache-konan
- name: Cache Gradle
uses: ./.github/actions/cache-gradle
- name: Calculate coverage
run: ./gradlew koverMergedXmlReport --stacktrace
- name: Run assemble
run: ./gradlew assemble --stacktrace
shell: bash
- name: Upload coverage report
uses: actions/upload-artifact@v3
with:
name: coverage-report
path: build/reports/kover

upload-reports:
needs: [ test, coverage ]
needs: [ assemble, coverage ]
runs-on: ubuntu-latest
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand Down Expand Up @@ -162,9 +152,9 @@ jobs:
- name: Upload reports to SonarCloud
run: ./gradlew sonarqube --stacktrace
shell: bash

deploy-snapshot:
needs: [ test, coverage ]
needs: [ assemble, coverage ]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -190,9 +180,9 @@ jobs:
- name: Deploy snapshot
run: ./gradlew publish -Dsnapshot=true --stacktrace
shell: bash

deploy-release:
needs: [ test, coverage ]
needs: [ assemble, coverage ]
if: startsWith(github.ref, 'refs/tags')
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -220,7 +210,7 @@ jobs:
shell: bash

deploy-gh-pages:
needs: [ test, coverage ]
needs: [ assemble, coverage ]
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 37b3dfc

Please sign in to comment.