WOR-1817: Refactor api service tests (#3033) #13491
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
name: Scala tests with coverage | |
on: | |
pull_request: | |
paths-ignore: [ '**.md' ] | |
push: | |
paths-ignore: [ '**.md' ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Start MySQL | |
run: | | |
sh docker/run-mysql.sh start | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
cache: sbt | |
- name: Run tests | |
id: tests | |
run: >- | |
sbt clean coverage test coverageReport | |
-J-Xmx3g | |
-Denv.type=test | |
-Dmysql.host=localhost | |
-Dmysql.port=3310 | |
it:compile | |
# A known github bug results in 'annotations generated in a Github action during a step executed in | |
# the “pull request” event, end up in the “workflow” for the "push’ event.' | |
# Until they fix that problem, we must ensure this step creates a unique check_name, else | |
# the pull_request and push checks will overwrite each other. | |
# https://github.com/ScaCap/action-surefire-report/issues/39 | |
# https://github.community/t/specify-check-suite-when-creating-a-checkrun/118380 | |
- name: Upload Test Report | |
uses: mikepenz/action-junit-report@v4 | |
if: ${{ always() }} | |
with: | |
report_paths: '**/target/test-reports/TEST-*.xml' | |
check_name: Test Report ${{ github.event_name }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Codecov upload | |
uses: codecov/codecov-action@v4 | |
if: ${{ always() }} | |
- name: Stop MySQL | |
run: | | |
sh docker/run-mysql.sh stop |