Merge pull request #63 from stslex/dev #34
This file contains hidden or 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: Send Report to Project | |
| on: | |
| push: | |
| branches: [ master ] | |
| workflow_dispatch: | |
| jobs: | |
| unitTests: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout branch | |
| uses: actions/checkout@v4 | |
| - run: | | |
| echo "${{ secrets.KEYSTORE }}" > keystore.jks.asc | |
| gpg -d --passphrase "${{ secrets.KEYSTORE_PASSPHRASE }}" --batch keystore.jks.asc > keystore.jks | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: 17 | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Gradle Wrapper Validation | |
| uses: gradle/wrapper-validation-action@v3 | |
| - name: Cache Gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle-. | |
| - name: Configure Keystore | |
| env: | |
| KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }} | |
| KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }} | |
| KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }} | |
| run: | | |
| echo "storeFile=keystore.jks" >> keystore.properties | |
| echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> keystore.properties | |
| echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> keystore.properties | |
| echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> keystore.properties | |
| - name: Build application | |
| run: ./gradlew koverHtmlReport --full-stacktrace | |
| - name: Check report files | |
| run: | | |
| ls /build/reports/kover/html/ | |
| - name: Archive code coverage results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: code-coverage-report | |
| path: /build/reports/kover/html/ | |
| saveReport: | |
| name: SaveReport | |
| runs-on: ubuntu-latest | |
| needs: [ unitTests ] | |
| steps: | |
| - name: Checkout branch | |
| uses: actions/checkout@v3 | |
| - name: Create local changes | |
| run: | | |
| rm -rf docs/reports | |
| mkdir docs/reports | |
| - name: Download report | |
| uses: actions/download-artifact@v3 | |
| with: | |
| name: code-coverage-report | |
| path: docs/reports | |
| - name: Check report files | |
| run: | | |
| ls docs/reports | |
| - name: Commit files | |
| run: | | |
| git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git add docs/reports | |
| git commit -m "Add changes" -a | |
| - name: Push changd | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.PUSH_TOKEN }} | |
| branch: ${{ github.ref }} |