Skip to content

Commit

Permalink
#184: Sbt cross-build is broken (#198)
Browse files Browse the repository at this point in the history
* added/adjusted job names
* build.yml updated
* fixed and merged the two JaCoCo workflows
  • Loading branch information
benedeki authored May 27, 2024
1 parent cc8892e commit 190e2fb
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 202 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/assign_issue_to_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
#

name: Auto Assign Issue to Project
name: Assign Issue to Project

on:
issues:
Expand Down
66 changes: 12 additions & 54 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
#

name: Build all modules
name: Build All Modules

on:
pull_request:
Expand All @@ -23,7 +23,8 @@ on:
types: [ opened, synchronize, reopened ]

jobs:
build-agent-and-model:
test-agent-and-model:
name: Test Agent and Model
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -36,55 +37,13 @@ jobs:
java-version: "[email protected]"

- name: Build and run unit tests
run: sbt "project agent" test doc "project model" test doc

build-server-unit:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: coursier/cache-action@v5

- name: Setup Scala
uses: olafurpg/setup-scala@v14
with:
java-version: "[email protected]"

- name: Build and run unit tests
run: sbt "project server" test

build-server-integration:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: atum_db
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: coursier/cache-action@v5

- name: Setup Scala
uses: olafurpg/setup-scala@v14
with:
java-version: "[email protected]"

- name: Prepare testing database
run: sbt flywayMigrate
run: sbt "project model" test doc "project agent_spark3" test doc

- name: Build and run integration tests
run: sbt "project server" testIT doc
run: sbt "project model" testIT "project agent_spark3" testIT

build-database:
test-database-and-server:
name: Test Database and Server
runs-on: ubuntu-latest
services:
postgres:
Expand All @@ -107,14 +66,13 @@ jobs:
- name: Setup Scala
uses: olafurpg/setup-scala@v14
with:
java-version: "adopt@1.8"
java-version: "adopt@1.11.0-11"

# Fails on balta dbConnection error issue: https://github.com/AbsaOSS/balta/issues/23
# - name: Build and run unit tests
# run: sbt "project database" test
- name: Build and run unit tests
run: sbt "project database" test doc "project server" test doc

- name: Prepare testing database
run: sbt flywayMigrate

- name: Build and run database/integration tests
run: sbt testDB doc
- name: Build and run integration tests
run: sbt "project database" testIT "project server" testIT
5 changes: 3 additions & 2 deletions .github/workflows/dependent_items.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
#

name: Dependent Issues
name: Dependent Items

on:
issues:
Expand All @@ -40,7 +40,8 @@ on:
- cron: '0 0 * * *'

jobs:
check:
dependent-items-check:
name: Dependent Items Check
runs-on: ubuntu-latest
steps:
- uses: z0al/[email protected]
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/format_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
# limitations under the License.
#

name: FormatCheck
name: Format Check

on:
pull_request:
branches: [ master, develop ]
types: [ assigned, opened, synchronize, reopened, labeled ]
branches: [ master ]
types: [ assigned, opened, synchronize ]

jobs:
scalafmt:
scala-format-check:
name: Scala Format Check
runs-on: ubuntu-latest
name: Scalafmt Check
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down
117 changes: 0 additions & 117 deletions .github/workflows/jacoco_check_server.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
#

name: JaCoCo report agent and module
name: JaCoCo Report

on:
pull_request:
Expand All @@ -28,48 +28,69 @@ env:
changed: 80.0

jobs:
test:
name: Build and test
build-test-and-measure:
name: Build, Test and Measure
runs-on: ubuntu-latest

services:
postgres:
image: postgres:15
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: atum_db
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Scala
uses: olafurpg/setup-scala@v14
with:
java-version: "[email protected]"
java-version: "[email protected]"
- name: Prepare testing database
run: sbt flywayMigrate
- name: Build and run tests
continue-on-error: true
id: jacocorun
run: |
sbt "project agent; jacoco"
sbt "project model; jacoco"
# agent module code coverage
- name: Add coverage to PR
run: sbt jacoco
- name: Add coverage to PR (model)
if: steps.jacocorun.outcome == 'success'
id: jacoco-model
uses: madrapps/[email protected]
with:
paths: ${{ github.workspace }}/model/target/jvm-${{ env.scalaShort }}/jacoco/report/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: ${{ env.overall }}
min-coverage-changed-files: ${{ env.changed }}
title: JaCoCo model module code coverage report - scala ${{ env.scalaLong }}
update-comment: true
- name: Add coverage to PR (agent)
if: steps.jacocorun.outcome == 'success'
id: jacoco-agent
uses: madrapps/[email protected]
with:
name: agent-jacoco-report
paths: ${{ github.workspace }}/agent/target/jvm-${{ env.scalaShort }}/jacoco/report/jacoco.xml
paths: ${{ github.workspace }}/agent/target/spark3-jvm-${{ env.scalaShort }}/jacoco/report/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: ${{ env.overall }}
min-coverage-changed-file: ${{ env.changed }}
min-coverage-changed-files: ${{ env.changed }}
title: JaCoCo agent module code coverage report - scala ${{ env.scalaLong }}
update-comment: true
# model module code coverage
- name: Add coverage to PR
- name: Add coverage to PR (server)
if: steps.jacocorun.outcome == 'success'
id: jacoco-model
id: jacoco-server
uses: madrapps/[email protected]
with:
name: model-jacoco-report
paths: ${{ github.workspace }}/model/target/jvm-${{ env.scalaShort }}/jacoco/report/jacoco.xml
paths: ${{ github.workspace }}/server/target/jvm-${{ env.scalaShort }}/jacoco/report/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: ${{ env.overall }}
min-coverage-changed-file: ${{ env.changed }}
title: JaCoCo model module code coverage report - scala ${{ env.scalaLong }}
min-coverage-overall: ${{env.overall }}
min-coverage-changed-files: ${{ env.changed }}
title: JaCoCo server module code coverage report - scala ${{ env.scalaLong }}
update-comment: true
- name: Get the Coverage info
if: steps.jacocorun.outcome == 'success'
Expand All @@ -78,6 +99,8 @@ jobs:
echo "Changed Files coverage ${{ steps.jacoco-agent.outputs.coverage-changed-files }}"
echo "Total model module coverage ${{ steps.jacoco-model.outputs.coverage-overall }}"
echo "Changed Files coverage ${{ steps.jacoco-model.outputs.coverage-changed-files }}"
echo "Total server module coverage ${{ steps.jacoco-server.outputs.coverage-overall }}"
echo "Changed Files coverage ${{ steps.jacoco-server.outputs.coverage-changed-files }}"
- name: Fail PR if changed files coverage is less than ${{ env.changed }}%
if: steps.jacocorun.outcome == 'success'
uses: actions/github-script@v6
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/license_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ on:
types: [ opened, synchronize, reopened ]

jobs:
license-test:
license-check:
name: License Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down
Loading

0 comments on commit 190e2fb

Please sign in to comment.