Skip to content

Commit c9b6dc3

Browse files
committed
update workflows
1 parent 9177745 commit c9b6dc3

File tree

6 files changed

+167
-166
lines changed

6 files changed

+167
-166
lines changed

.github/workflows/build.yml

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
1-
#name: Build
2-
#on: [push]
3-
#jobs:
4-
# build:
5-
# runs-on: ubuntu-20.04
6-
# steps:
7-
# - uses: actions/checkout@v2
8-
# - name: Set up JDK 11
9-
# uses: actions/setup-java@v2
10-
# with:
11-
# java-version: '11'
12-
# distribution: 'adopt'
13-
# - name: Cache Java modules
14-
# uses: actions/cache@v2
15-
# env:
16-
# cache-name: cache-java-modules
17-
# with:
18-
# path: ~/.m2
19-
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./build.sbt') }}
20-
# restore-keys: |
21-
# ${{ runner.os }}-build-${{ env.cache-name }}-
22-
# ${{ runner.os }}-build-
23-
# ${{ runner.os }}-
24-
# - name: Cache Scala modules
25-
# uses: actions/cache@v2
26-
# env:
27-
# cache-name: cache-scala-modules
28-
# with:
29-
# path: ~/.m2
30-
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./build.sbt') }}
31-
# restore-keys: |
32-
# ${{ runner.os }}-build-${{ env.cache-name }}-
33-
# ${{ runner.os }}-build-
34-
# ${{ runner.os }}-
35-
# - name: Cache Sbt modules
36-
# uses: actions/cache@v2
37-
# env:
38-
# cache-name: cache-sbt-modules
39-
# with:
40-
# path: ~/.sbt/1.0
41-
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./build.sbt') }}
42-
# restore-keys: |
43-
# ${{ runner.os }}-build-${{ env.cache-name }}-
44-
# ${{ runner.os }}-build-
45-
# ${{ runner.os }}-
46-
# - name: Run Sbt Test and Generate Report on Multiple Scala Versions
47-
# run: |
48-
# sbt +package
1+
name: Build
2+
on: [push]
3+
jobs:
4+
build:
5+
runs-on: ubuntu-20.04
6+
steps:
7+
- uses: actions/checkout@v2
8+
- name: Set up JDK 11
9+
uses: actions/setup-java@v2
10+
with:
11+
java-version: '11'
12+
distribution: 'adopt'
13+
- name: Cache Java modules
14+
uses: actions/cache@v2
15+
env:
16+
cache-name: cache-java-modules
17+
with:
18+
path: ~/.m2
19+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./build.sbt') }}
20+
restore-keys: |
21+
${{ runner.os }}-build-${{ env.cache-name }}-
22+
${{ runner.os }}-build-
23+
${{ runner.os }}-
24+
- name: Cache Scala modules
25+
uses: actions/cache@v2
26+
env:
27+
cache-name: cache-scala-modules
28+
with:
29+
path: ~/.m2
30+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./build.sbt') }}
31+
restore-keys: |
32+
${{ runner.os }}-build-${{ env.cache-name }}-
33+
${{ runner.os }}-build-
34+
${{ runner.os }}-
35+
- name: Cache Sbt modules
36+
uses: actions/cache@v2
37+
env:
38+
cache-name: cache-sbt-modules
39+
with:
40+
path: ~/.sbt/1.0
41+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./build.sbt') }}
42+
restore-keys: |
43+
${{ runner.os }}-build-${{ env.cache-name }}-
44+
${{ runner.os }}-build-
45+
${{ runner.os }}-
46+
- name: Run Sbt Test and Generate Report on Multiple Scala Versions
47+
run: |
48+
sbt +package

.github/workflows/linter.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
#name: Linter
2-
#on: [push]
3-
#jobs:
4-
# linter:
5-
# runs-on: ubuntu-latest
6-
# steps:
7-
# - uses: actions/checkout@v2
8-
# - name: Set up JDK 11
9-
# uses: actions/setup-java@v2
10-
# with:
11-
# java-version: '11'
12-
# distribution: 'adopt'
13-
# - name: Run Scalastyle Linter
14-
# run: |
15-
# sbt +scalastyle
16-
# sbt +test:scalastyle
1+
name: Linter
2+
on: [push]
3+
jobs:
4+
linter:
5+
runs-on: ubuntu-20.04
6+
steps:
7+
- uses: actions/checkout@v2
8+
- name: Set up JDK 11
9+
uses: actions/setup-java@v2
10+
with:
11+
java-version: '11'
12+
distribution: 'adopt'
13+
- name: Run Scalastyle Linter
14+
run: |
15+
sbt +scalastyle
16+
sbt +test:scalastyle

.github/workflows/release.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: Publish documentation to project website and package to the Maven Central Repository
22
on:
3-
[push]
4-
# release:
5-
# types: [created]
3+
release:
4+
types: [created]
65
jobs:
76
publish-doc:
87
runs-on: ubuntu-20.04
@@ -15,7 +14,7 @@ jobs:
1514
with:
1615
token: ${{ secrets.PAT_TOKEN }}
1716
- name: Generate API Doc
18-
run: sbt doc
17+
run: sbt +doc
1918
- name: Make API Doc directory outside repository
2019
run: mkdir -p ../api_docs
2120
- name: Move API Docs to outside directory
@@ -44,8 +43,7 @@ jobs:
4443
git commit -m "[RELEASE] Update doc version from branch \"$GITHUB_REF\" commit \"$GITHUB_REF\""
4544
git push
4645
47-
# - name: something else3
48-
# run: ls ../
46+
4947
# publish-package:
5048
# runs-on: ubuntu-latest
5149
# needs: [publish-doc]

.github/workflows/tests.yml

Lines changed: 98 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,98 @@
1-
#name: Unittests
2-
#on: [push]
3-
#jobs:
4-
# retrieve-scala-versions:
5-
# runs-on: ubuntu-20.04
6-
# steps:
7-
# - uses: actions/checkout@v2
8-
# - name: Set up JDK 11
9-
# uses: actions/setup-java@v2
10-
# with:
11-
# java-version: '11'
12-
# distribution: 'adopt'
13-
# - name: Retrieve Scala Versions from build.sbt file
14-
# id: set-matrix
15-
# run: |
16-
# scalaVersionPref=$(sbt +scalaBinaryVersion | sed -r 's/[^ \t\r\n\v\f0-9\.]([0-9]\.[0-9]+)/SCALA_VERSION\1/' | grep -oE 'CALA_VERSION[0-9]\.[0-9]+')
17-
# scala_versions=$(echo "$scalaVersionPref" | sed -r 's/CALA_VERSION([0-9]\.[0-9]+)/\1/' | tr '\n' ',')
18-
# scala_versions="[${scala_versions%?}]"
19-
# echo ::set-output name=matrix::"$scala_versions"
20-
# outputs:
21-
# scala_versions: ${{ steps.set-matrix.outputs.matrix }}
22-
#
23-
# test-coverage:
24-
# runs-on: ubuntu-20.04
25-
# steps:
26-
# - uses: actions/checkout@v2
27-
# - name: Set up JDK 11
28-
# uses: actions/setup-java@v2
29-
# with:
30-
# java-version: '11'
31-
# distribution: 'adopt'
32-
# - name: Cache Java modules
33-
# uses: actions/cache@v2
34-
# env:
35-
# cache-name: cache-java-modules
36-
# with:
37-
# path: ~/.m2
38-
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./build.sbt') }}
39-
# restore-keys: |
40-
# ${{ runner.os }}-build-${{ env.cache-name }}-
41-
# ${{ runner.os }}-build-
42-
# ${{ runner.os }}-
43-
# - name: Cache Scala modules
44-
# uses: actions/cache@v2
45-
# env:
46-
# cache-name: cache-scala-modules
47-
# with:
48-
# path: ~/.m2
49-
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./build.sbt') }}
50-
# restore-keys: |
51-
# ${{ runner.os }}-build-${{ env.cache-name }}-
52-
# ${{ runner.os }}-build-
53-
# ${{ runner.os }}-
54-
# - name: Cache Sbt modules
55-
# uses: actions/cache@v2
56-
# env:
57-
# cache-name: cache-sbt-modules
58-
# with:
59-
# path: ~/.sbt/1.0
60-
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./build.sbt') }}
61-
# restore-keys: |
62-
# ${{ runner.os }}-build-${{ env.cache-name }}-
63-
# ${{ runner.os }}-build-
64-
# ${{ runner.os }}-
65-
# - name: Run Sbt Test and Generate Report on Multiple Scala Versions
66-
# run: |
67-
# sbt +coverage +test
68-
# sbt +coverageReport
69-
# - uses: actions/upload-artifact@v2
70-
# with:
71-
# name: coverage-report
72-
# path: ./target/scala-[0-9].[0-9][0-9]
73-
#
74-
# upload-coverage:
75-
# runs-on: ubuntu-latest
76-
# needs: [retrieve-scala-versions, test-coverage]
77-
# strategy:
78-
# fail-fast: false
79-
# matrix:
80-
# scala_version: ${{ fromJSON(needs.retrieve-scala-versions.outputs.scala_versions) }}
81-
# steps:
82-
# - uses: actions/checkout@v2
83-
# - uses: actions/download-artifact@v2
84-
# with:
85-
# name: coverage-report
86-
# path: ./target/
87-
# - uses: codecov/codecov-action@v2
88-
# with:
89-
# token: ${{ secrets.CODECOV_TOKEN }}
90-
# directory: ./target/scala-${{ matrix.scala_version }}/
91-
# flags: unittests,${{ matrix.scala_version }}/scoverage-report/scoverage.xml
92-
# name: codecov-json-logic-scala
93-
# fail_ci_if_error: true
94-
# verbose: true
1+
name: Unittests
2+
on: [push]
3+
jobs:
4+
retrieve-scala-versions:
5+
runs-on: ubuntu-20.04
6+
steps:
7+
- name: Install ansi2txt tool
8+
run: |
9+
sudo apt-get update
10+
sudo apt-get install colorized-logs
11+
- uses: actions/checkout@v2
12+
- name: Set up JDK 11
13+
uses: actions/setup-java@v2
14+
with:
15+
java-version: '11'
16+
distribution: 'adopt'
17+
- name: Retrieve Scala Versions from build.sbt file
18+
id: set-matrix
19+
run: |
20+
scalaVersionPref=$(sbt +scalaBinaryVersion | ansi2txt | grep -Eo '\[info\] [0-9]\.[0-9][0-9]' | sed -r 's/\[info\] ([0-9]\.[0-9][0-9])/\1/')
21+
scala_versions=$(echo "$scalaVersionPref" | tr '\n' ',')
22+
scala_versions="[${scala_versions%?}]"
23+
echo ::set-output name=matrix::"$scala_versions"
24+
outputs:
25+
scala_versions: ${{ steps.set-matrix.outputs.matrix }}
26+
27+
test-coverage:
28+
runs-on: ubuntu-20.04
29+
steps:
30+
- uses: actions/checkout@v2
31+
- name: Set up JDK 11
32+
uses: actions/setup-java@v2
33+
with:
34+
java-version: '11'
35+
distribution: 'adopt'
36+
- name: Cache Java modules
37+
uses: actions/cache@v2
38+
env:
39+
cache-name: cache-java-modules
40+
with:
41+
path: ~/.m2
42+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./build.sbt') }}
43+
restore-keys: |
44+
${{ runner.os }}-build-${{ env.cache-name }}-
45+
${{ runner.os }}-build-
46+
${{ runner.os }}-
47+
- name: Cache Scala modules
48+
uses: actions/cache@v2
49+
env:
50+
cache-name: cache-scala-modules
51+
with:
52+
path: ~/.m2
53+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./build.sbt') }}
54+
restore-keys: |
55+
${{ runner.os }}-build-${{ env.cache-name }}-
56+
${{ runner.os }}-build-
57+
${{ runner.os }}-
58+
- name: Cache Sbt modules
59+
uses: actions/cache@v2
60+
env:
61+
cache-name: cache-sbt-modules
62+
with:
63+
path: ~/.sbt/1.0
64+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./build.sbt') }}
65+
restore-keys: |
66+
${{ runner.os }}-build-${{ env.cache-name }}-
67+
${{ runner.os }}-build-
68+
${{ runner.os }}-
69+
- name: Run Sbt Test and Generate Report on Multiple Scala Versions
70+
run: |
71+
sbt +coverage +test
72+
sbt +coverageReport
73+
- uses: actions/upload-artifact@v2
74+
with:
75+
name: coverage-report
76+
path: ./target/scala-[0-9].[0-9][0-9]
77+
78+
upload-coverage:
79+
runs-on: ubuntu-latest
80+
needs: [retrieve-scala-versions, test-coverage]
81+
strategy:
82+
fail-fast: false
83+
matrix:
84+
scala_version: ${{ fromJSON(needs.retrieve-scala-versions.outputs.scala_versions) }}
85+
steps:
86+
- uses: actions/checkout@v2
87+
- uses: actions/download-artifact@v2
88+
with:
89+
name: coverage-report
90+
path: ./target/
91+
- uses: codecov/codecov-action@v2
92+
with:
93+
token: ${{ secrets.CODECOV_TOKEN }}
94+
directory: ./target/scala-${{ matrix.scala_version }}/
95+
flags: unittests,${{ matrix.scala_version }}/scoverage-report/scoverage.xml
96+
name: codecov-json-logic-scala
97+
fail_ci_if_error: true
98+
verbose: true

.workflow-scripts/move_scala_docs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ do
88
cp -r "$1/scala-$scala_version/$api_version" "$2/scala-$scala_version/latest"
99
mv "$1/scala-$scala_version/$api_version" "$2/scala-$scala_version/"
1010
python "$3/update_json_api_versions.py" "$4" "$api_version" --scala-versions "$scala_versions"
11-
done
11+
done

.workflow-scripts/put_scala_docs_aside.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
# shellcheck disable=SC2010
44
scala_versions=$(ls "$1" | grep -Eo "[0-9]\.[0-9][0-9]")
5-
#api_version=$(sbt version | sed -r 's/[^ \t\r\n\v\f0-9\.i?n?f?o?]+ (.+)/APP_VERSION\1/' | sed -n '6p' | grep -Po '(?<=PP_VERSION)(.+)')
65
api_version=$(sbt version | ansi2txt | tail -n1 | sed -r 's/^\[info\] (.+)$/\1/')
76

87
export scala_versions

0 commit comments

Comments
 (0)