Skip to content

Commit

Permalink
W-17683749: wip coverage step
Browse files Browse the repository at this point in the history
  • Loading branch information
damianpedra committed Jan 29, 2025
1 parent 49b5bc7 commit 7c44d8b
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Code Coverage

on:
push:
branches:
- your-branch-name # Replace with your test branch
pull_request:
branches:
- main

jobs:
coverage:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'

- name: Install SBT
run: |
echo "Installing SBT..."
curl -L https://scala.jfrog.io/artifactory/debian/sbt-1.9.8.deb -o sbt.deb
sudo dpkg -i sbt.deb
sudo apt-get update
sudo apt-get install -f
sbt sbtVersion
- name: Cache SBT dependencies
uses: actions/cache@v3
with:
path: |
~/.ivy2/cache
~/.sbt
~/.cache/coursier
key: sbt-${{ runner.os }}-${{ hashFiles('**/build.sbt') }}
restore-keys: |
sbt-${{ runner.os }}-
- name: Run Tests with Coverage
run: sbt clean coverage test coverageAggregate

- name: Upload Coverage Report
uses: actions/upload-artifact@v3
with:
name: coverage-report
path: target/scala-*/scoverage-report/

- name: Run SonarQube Scan
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: "https://sonarcloud.io"
run: |
sbt -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_TOKEN sonarScan

0 comments on commit 7c44d8b

Please sign in to comment.