Skip to content

Commit b475ed6

Browse files
authored
Merge branch 'master' into dependabot/maven/org.apache.spark-spark-core_2.12-3.4.0
2 parents 5b03fc8 + 3d7debc commit b475ed6

File tree

195 files changed

+10522
-2389
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

195 files changed

+10522
-2389
lines changed

.fossa.yml

+28-20
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
1-
# Generated by FOSSA CLI (https://github.com/fossas/fossa-cli)
21
# Visit https://fossa.com to learn more
32

4-
version: 2
5-
cli:
6-
server: https://app.fossa.com
7-
fetcher: custom
8-
project: cobrix
9-
analyze:
10-
modules:
11-
- name: cobol-parser_2.11
12-
type: mvn
13-
target: cobol-parser/pom.xml
14-
path: .
15-
options:
16-
cmd: "mvn dependency:tree -Dscope=compile | grep -v provided"
17-
- name: spark-cobol_2.11
18-
type: mvn
19-
target: spark-cobol/pom.xml
20-
path: .
21-
options:
22-
cmd: "mvn dependency:tree -Dscope=compile | grep -v provided"
3+
version: 3
4+
5+
server: https://app.fossa.com
6+
7+
project:
8+
id: github.com/AbsaOSS/cobrix
9+
name: cobrix
10+
policy: custom-cli-policy
11+
link: fossa.com
12+
url: github.com/AbsaOSS/cobrix
13+
14+
targets:
15+
only:
16+
- type: scala
17+
path: cobrix
18+
19+
paths:
20+
only:
21+
- cobol-parser
22+
- cobol-converters
23+
- spark-cobol
24+
- target
25+
exclude:
26+
- ./examples
27+
- ./project
28+
29+
telemetry:
30+
scope: "off"

.github/workflows/build.yml

+32-8
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,52 @@ on:
55
branches: [ master ]
66
pull_request:
77
branches: [ master ]
8+
paths:
9+
- "cobol-parser/**"
10+
- "cobol-converters/**"
11+
- "spark-cobol/**"
12+
- "project/**"
13+
- "build.sbt"
14+
- ".github/workflows/build.yml"
815

916
jobs:
1017
build-sbt:
1118
runs-on: ubuntu-latest
1219
strategy:
1320
fail-fast: false
1421
matrix:
15-
scala: [ 2.11.12, 2.12.17, 2.13.10 ]
16-
spark: [ 2.4.8, 3.3.2 ]
22+
scala: [ 2.11.12, 2.12.20, 2.13.15 ]
23+
spark: [ 2.4.8, 3.4.3, 3.5.3 ]
1724
exclude:
1825
- scala: 2.11.12
19-
spark: 3.3.2
20-
- scala: 2.13.10
26+
spark: 3.4.3
27+
- scala: 2.11.12
28+
spark: 3.5.3
29+
- scala: 2.12.20
30+
spark: 2.4.8
31+
- scala: 2.13.15
2132
spark: 2.4.8
2233
name: Spark ${{matrix.spark}} on Scala ${{matrix.scala}}
2334
steps:
2435
- name: Checkout code
25-
uses: actions/checkout@v2
36+
uses: actions/checkout@v4
2637
- uses: coursier/cache-action@v5
27-
- name: Setup Scala
28-
uses: olafurpg/setup-scala@v10
38+
- name: Setup JDK
39+
uses: actions/setup-java@v4
2940
with:
30-
java-version: "[email protected]"
41+
distribution: temurin
42+
java-version: 8
43+
cache: sbt
44+
- name: Install sbt
45+
run: |
46+
sudo apt-get update
47+
sudo apt-get install apt-transport-https curl gnupg -yqq
48+
echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list
49+
echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list
50+
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo -H gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/scalasbt-release.gpg --import
51+
sudo chmod 644 /etc/apt/trusted.gpg.d/scalasbt-release.gpg
52+
sudo apt-get update
53+
sudo apt-get install sbt
54+
3155
- name: Build and run tests
3256
run: sbt ++${{matrix.scala}} test -DSPARK_VERSION=${{matrix.spark}}

.github/workflows/fossa.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ on:
1111
- '**.svg'
1212

1313
jobs:
14-
build:
14+
fossa:
1515
runs-on: ubuntu-latest
1616

1717
steps:
1818
- name: Checkout code
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@v4
2020

2121
- name: Run FOSSA scan and upload build data
22-
uses: fossa-contrib/fossa-action@v1
22+
uses: fossa-contrib/fossa-action@v2
2323
with:
24-
fossa-api-key: ab616dfa5101a6039259372543d60ccb
24+
fossa-api-key: ${{secrets.FOSSA_API_KEY}}

.github/workflows/jacoco_check.yml

+51-24
Original file line numberDiff line numberDiff line change
@@ -19,57 +19,84 @@ name: JaCoCo report
1919
on:
2020
pull_request:
2121
branches: [ master ]
22-
types: [ opened, edited, synchronize, reopened ]
22+
paths:
23+
- "cobol-parser/**"
24+
- "cobol-converters/**"
25+
- "spark-cobol/**"
26+
- "project/**"
27+
- "build.sbt"
2328

2429
jobs:
2530
test:
26-
runs-on: ubuntu-latest
31+
runs-on: ubuntu-22.04
2732
strategy:
2833
matrix:
34+
# The project supports Scala 2.11, 2.12, 2.13
35+
# The CI runs all tests suites for all supported Scala versions at build.yml
36+
# The codebase for all Scala versions is the same, so the coverage is calculated only once
37+
# Scala 2.12 is chosen since it is supported by the most wide range of Spark versions and
38+
# vendor distributions.
2939
include:
30-
- scala: 2.11.12
31-
scalaShort: "2.11"
32-
spark: 2.4.8
33-
overall: 0.0
34-
changed: 80.0
35-
- scala: 2.12.17
40+
- scala: 2.12.20
3641
scalaShort: "2.12"
37-
spark: 3.2.3
38-
overall: 0.0
39-
changed: 80.0
40-
- scala: 2.13.10
41-
scalaShort: "2.13"
42-
spark: 3.3.2
42+
spark: 3.3.4
4343
overall: 0.0
4444
changed: 80.0
45+
46+
# Historically, 'cobol-parser' module was part of 'spark-cobol' and the coverage is combined.
47+
# Jacoco can't combine coverage across modules, so until 'cobol-parser' has unit tests
48+
# that covers the same codepade from the same module, the coverage requirement is lowered to 20%.
49+
changedCobolParserOverride: 20
4550
steps:
4651
- name: Checkout code
47-
uses: actions/checkout@v2
48-
- name: Setup Scala
49-
uses: olafurpg/setup-scala@v10
52+
uses: actions/checkout@v4
53+
- name: Setup JDK
54+
uses: actions/setup-java@v4
5055
with:
51-
java-version: "[email protected]"
56+
distribution: temurin
57+
java-version: 8
58+
cache: sbt
5259
- name: Build and run tests
5360
run: sbt ++${{matrix.scala}} jacoco -DSPARK_VERSION=${{matrix.spark}}
54-
- name: Add coverage to PR
61+
- name: Add coverage of 'cobol-parser' to PR
62+
id: jacocoParser
63+
uses: madrapps/[email protected]
64+
with:
65+
paths: >
66+
${{ github.workspace }}/cobol-parser/target/scala-${{ matrix.scalaShort }}/jacoco/report/jacoco.xml
67+
token: ${{ secrets.GITHUB_TOKEN }}
68+
min-coverage-overall: ${{ matrix.overall }}
69+
min-coverage-changed-files: ${{ matrix.changedCobolParserOverride }}
70+
title: JaCoCo code coverage report - 'cobol-parser'
71+
update-comment: true
72+
- name: Get the Coverage info
73+
run: |
74+
echo "Total coverage ${{ steps.jacoco.outputs.coverage-overall }}"
75+
echo "Changed Files coverage ${{ steps.jacoco.outputs.coverage-changed-files }}"
76+
- name: Add coverage of 'spark-cobol' to PR
5577
id: jacoco
5678
uses: madrapps/[email protected]
5779
with:
5880
paths: >
59-
${{ github.workspace }}/cobol-parser/target/scala-${{ matrix.scalaShort }}/jacoco/report/jacoco.xml,
6081
${{ github.workspace }}/spark-cobol/target/scala-${{ matrix.scalaShort }}/jacoco/report/jacoco.xml
6182
token: ${{ secrets.GITHUB_TOKEN }}
6283
min-coverage-overall: ${{ matrix.overall }}
6384
min-coverage-changed-files: ${{ matrix.changed }}
64-
title: JaCoCo code coverage report - scala ${{ matrix.scala }} - spark ${{ matrix.spark }}
85+
title: JaCoCo code coverage report - 'spark-cobol'
6586
update-comment: true
6687
- name: Get the Coverage info
6788
run: |
6889
echo "Total coverage ${{ steps.jacoco.outputs.coverage-overall }}"
6990
echo "Changed Files coverage ${{ steps.jacoco.outputs.coverage-changed-files }}"
70-
- name: Fail PR if changed files coverage is less than ${{ matrix.changed }}%
71-
if: ${{ steps.jacoco.outputs.coverage-changed-files < 80.0 }}
91+
- name: Fail PR if changed files coverage for 'cobol-parser' is less than ${{ matrix.changedCobolParserOverride }}%
92+
if: ${{ steps.jacocoParser.outputs.coverage-changed-files < matrix.changedCobolParserOverride }}
93+
uses: actions/github-script@v6
94+
with:
95+
script: |
96+
core.setFailed('Changed files coverage is less than ${{ matrix.changedCobolParserOverride }}% for 'cobol-parser'!')
97+
- name: Fail PR if changed files coverage for 'spark-cobol' is less than ${{ matrix.changed }}%
98+
if: ${{ steps.jacoco.outputs.coverage-changed-files < matrix.changed }}
7299
uses: actions/github-script@v6
73100
with:
74101
script: |
75-
core.setFailed('Changed files coverage is less than ${{ matrix.changed }}%!')
102+
core.setFailed('Changed files coverage is less than ${{ matrix.changed }}% for 'spark-cobol!')

.github/workflows/release.yaml

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
#
2+
# Copyright 2022 ABSA Group Limited
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
name: Release
18+
19+
on:
20+
workflow_dispatch:
21+
22+
defaults:
23+
run:
24+
shell: bash
25+
26+
jobs:
27+
release-sbt:
28+
runs-on: ubuntu-latest
29+
name: Release Scala artifacts
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v4
33+
with:
34+
ref: ${{ github.head_ref || github.ref_name }}
35+
36+
- name: Prepare the release branch
37+
run: |
38+
VERSION=$(grep "ThisBuild / version" version.sbt | cut -d\" -f2 | sed 's/-SNAPSHOT//')
39+
git config --global user.email "[email protected]"
40+
git config --global user.name "CI/CD bot"
41+
git checkout -b release/$VERSION
42+
git push --set-upstream origin release/$VERSION
43+
44+
- name: Setup JDK and sbt
45+
uses: actions/[email protected]
46+
with:
47+
distribution: temurin
48+
java-version: 8
49+
cache: sbt
50+
51+
- name: Install sbt
52+
run: |
53+
sudo apt-get update
54+
sudo apt-get install apt-transport-https curl gnupg -yqq
55+
echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list
56+
echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list
57+
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo -H gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/scalasbt-release.gpg --import
58+
sudo chmod 644 /etc/apt/trusted.gpg.d/scalasbt-release.gpg
59+
sudo apt-get update
60+
sudo apt-get install sbt
61+
62+
- name: Import GPG Key
63+
run: |
64+
echo "${{ secrets.ABSA_OSS_CI_CD_BOT_GPG_KEY }}" > gpg-secret-key.asc
65+
gpg --import --batch gpg-secret-key.asc && rm -rf gpg-secret-key.asc
66+
mkdir -p ~/.gnupg
67+
68+
- name: Setup SonaType config
69+
run: |
70+
mkdir -p ~/.sbt/1.0
71+
echo "${{ secrets.SONATYPE_CONFIG }}" | base64 --decode > ~/.sbt/1.0/sonatype.sbt
72+
73+
- name: Checkout the release branch
74+
run: |
75+
VERSION=$(grep "ThisBuild / version" version.sbt | cut -d\" -f2 | sed 's/-SNAPSHOT//')
76+
git fetch origin release/$VERSION
77+
git checkout release/$VERSION
78+
79+
- name: Run the release plugin
80+
run: sbt releaseNow
81+
82+
create-pr:
83+
needs: [ "release-sbt" ]
84+
runs-on: ubuntu-latest
85+
name: Create Pull Request
86+
87+
steps:
88+
- name: Checkout code
89+
uses: actions/checkout@v4
90+
with:
91+
ref: ${{ github.head_ref || github.ref_name }}
92+
93+
- name: Checkout the release branch
94+
id: release_branch3
95+
run: |
96+
VERSION=$(grep "ThisBuild / version" version.sbt | cut -d\" -f2 | sed 's/-SNAPSHOT//')
97+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
98+
git config --global user.email "[email protected]"
99+
git config --global user.name "CI/CD bot"
100+
git fetch origin release/$VERSION
101+
git checkout release/$VERSION
102+
103+
- name: Create Pull Request
104+
run: gh pr create -B master -H "release/$VERSION" --title "Release Cobrix v$VERSION" --body 'Created by Github action'
105+
env:
106+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107+
VERSION: ${{ steps.release_branch3.outputs.VERSION }}

0 commit comments

Comments
 (0)