Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/dawidd6/action-dow…
Browse files Browse the repository at this point in the history
…nload-artifact-3.1.4
  • Loading branch information
alfonsorr authored Jul 18, 2024
2 parents 9a3da07 + dc2d583 commit ec22e8d
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 95 deletions.
76 changes: 0 additions & 76 deletions .github/actions/build_and_coverage/action.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ codecov:
branch: main
notify:
wait_for_ci: true
after_n_builds: 4
after_n_builds: 5

coverage:
precision: 2
Expand Down Expand Up @@ -37,4 +37,4 @@ comment:
layout: "reach,diff,flags,files,footer"
behavior: once # once: update, if exists. Otherwise, post new. Skip if deleted.
require_changes: false # if true: only post the comment if coverage changes
after_n_builds: 4
after_n_builds: 5
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: Check Dependencies
steps:
- name: PR Dependency Check
uses: gregsdennis/[email protected].2
uses: gregsdennis/[email protected].3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -64,6 +64,8 @@ jobs:
uses: ./.github/workflows/wc_build.yml
with:
matrix_filter: "[]"
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

# CHECK MDOC IS OK
check_mdoc:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency-graph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: scalacenter/sbt-dependency-submission@v2
- uses: scalacenter/sbt-dependency-submission@v3
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
uses: ./.github/workflows/wc_build.yml
with:
matrix_filter: "[?isRelease==`release`]"
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

# PUBLISH JARS AT MAVEN CENTRAL
matrix_prep:
Expand Down
77 changes: 73 additions & 4 deletions .github/workflows/wc_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
matrix_filter:
required: true
type: string
secrets:
CODECOV_TOKEN:
required: false

jobs:
matrix_prep:
Expand All @@ -29,7 +32,73 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/build_and_coverage
env:
SPARK_VERSION: ${{ matrix.spark }}
SCOPE: ${{ matrix.scope }}
# SETUP & CACHE
- uses: coursier/[email protected]
with:
jvm: adopt:8
apps: sbt scala scalafmt # https://github.com/coursier/apps

- uses: coursier/cache-action@v6
with:
extraKey: "${{ matrix.spark }}"

# CHECK CODE FORMAT
- name: Code Format
id: code_format
if: contains(matrix.scope, 'test')
run: sbt -DsparkVersion=${{ matrix.spark }} scalafmtCheckAll
shell: bash

# TESTING & COVERAGE
- name: Test & coverage 📋
id: test_coverage
if: steps.code_format.conclusion == 'success'
run: sbt -DsparkVersion=${{ matrix.spark }} coverage +core/test coverageAggregate
shell: bash

- name: Test Summary
id: test_summary
if: ${{ success() && steps.test_coverage.conclusion == 'success' || failure() && steps.test_coverage.conclusion == 'failure' }}
uses: test-summary/[email protected]
with:
paths: "./core/target/test-reports/**/TEST-*.xml"
output: "test-summary.md"

- name: Add 2 GitHub step summary
if: ${{ (success() || failure()) && steps.test_summary.conclusion == 'success' }}
shell: bash
run: cat test-summary.md >> $GITHUB_STEP_SUMMARY

- name: Add summary link
id: add_summary_link
if: ${{ (success() || failure()) && steps.test_summary.conclusion == 'success' }}
shell: bash
run: |
img=$(head -1 test-summary.md | perl -pe 's/(<.*?.>).*/$1/')
url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
echo "| ${{ matrix.spark }} | [${img}](${url}) |" > test-summary-${{ matrix.spark }}.md
cat -e test-summary-${{ matrix.spark }}.md
- name: Upload test summary
if: ${{ github.event_name == 'pull_request' && ((success() || failure()) && steps.add_summary_link.conclusion == 'success') }}
uses: actions/upload-artifact@v3
with:
name: "test-summary-${{ matrix.spark }}.md"
path: "test-summary-${{ matrix.spark }}.md"
if-no-files-found: error
retention-days: 1

- name: Publish coverage to codecov 📊
if: contains(matrix.scope, 'uploadReport')
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./target/scala-2.12/scoverage-report/scoverage.xml,./target/scala-2.13/scoverage-report/scoverage.xml
fail_ci_if_error: true
verbose: false
flags: 'spark-${{ matrix.spark }}.x'

# CLEAN PROJECT BEFORE CACHE
- name: Cleaning before cache 🚯
if: ${{ always() }}
uses: ./.github/actions/clean_cache
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.8.0"
version = "3.8.2"
runner.dialect = scala212
align.preset = more
maxColumn = 80
Expand Down
12 changes: 6 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ val spark35Version = "3.5.1"
val versionRegex = """^(.*)\.(.*)\.(.*)$""".r
val versionRegexShort = """^(.*)\.(.*)$""".r

val scala212 = "2.12.18"
val scala213 = "2.13.12"
val scala212 = "2.12.19"
val scala213 = "2.13.14"

val parserSparkVersion: String => String = {
case versionRegexShort("3", "0") => spark30Version
Expand Down Expand Up @@ -122,10 +122,10 @@ lazy val core = project
crossScalaVersions := scalaVersionSelect(sparkVersion.value),
libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-sql" % sparkVersion.value % "provided", // scala-steward:off
"org.typelevel" %% "cats-core" % "2.10.0",
"com.lihaoyi" %% "sourcecode" % "0.3.1",
"com.chuusai" %% "shapeless" % "2.3.10",
"org.scala-lang.modules" %% "scala-collection-compat" % "2.11.0",
"org.typelevel" %% "cats-core" % "2.12.0",
"com.lihaoyi" %% "sourcecode" % "0.4.2",
"com.chuusai" %% "shapeless" % "2.3.12",
"org.scala-lang.modules" %% "scala-collection-compat" % "2.12.0",
"com.github.mrpowers" %% "spark-fast-tests" % "1.3.0" % "test",
"org.scalatest" %% "scalatest" % "3.2.18" % "test"
),
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# suppress inspection "UnusedProperty"
sbt.version=1.9.9
sbt.version=1.10.1
6 changes: 3 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ logLevel := Level.Warn

addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.5.2")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.11")
addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "3.0.2")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.5.4")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.1.0")
addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "3.0.2")

0 comments on commit ec22e8d

Please sign in to comment.