Skip to content

Commit

Permalink
Merge pull request #603 from danicheg/series/1.x-sbt-typelevel
Browse files Browse the repository at this point in the history
Migrate to `sbt-typelevel` in `series/1.x`
  • Loading branch information
danicheg authored Feb 2, 2022
2 parents b72e08c + cd2c5fa commit b730526
Show file tree
Hide file tree
Showing 8 changed files with 168 additions and 332 deletions.
224 changes: 93 additions & 131 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@ name: Continuous Integration

on:
pull_request:
branches: ['*', series/*]
branches: ['**']
push:
branches: ['*', series/*]
tags: [v*, v*]
branches: ['**']
tags: [v*]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
build:
Expand All @@ -28,6 +29,14 @@ jobs:
os: [ubuntu-latest]
scala: [2.13.8, 2.12.15, 3.0.2]
java: [temurin@8, temurin@11]
project: [rootJS, rootJVM]
exclude:
- scala: 2.13.8
java: temurin@11
- scala: 2.12.15
java: temurin@11
- project: rootJS
java: temurin@11
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
Expand Down Expand Up @@ -62,21 +71,40 @@ jobs:
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Check that workflows are up to date
run: sbt ++${{ matrix.scala }} githubWorkflowCheck
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' 'project /' githubWorkflowCheck

- name: Check headers and formatting
if: matrix.java == 'temurin@8'
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' headerCheckAll scalafmtCheckAll 'project /' scalafmtSbtCheck

- name: fastOptJS
if: matrix.project == 'rootJS'
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' Test/fastOptJS

- name: Test
run: sbt ++${{ matrix.scala }} test
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' test

- name: Binary Compatibility Check
run: sbt ++${{ matrix.scala }} mimaReportBinaryIssues
- name: Check binary compatibility
if: matrix.java == 'temurin@8'
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' mimaReportBinaryIssues

- name: Generate API documentation
if: matrix.java == 'temurin@8'
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' doc

- name: Make target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
run: mkdir -p testing/jvm/target noop/jvm/target target .js/target site/target core/js/target testing/js/target noop/js/target core/jvm/target .jvm/target .native/target slf4j/target project/target

- name: Compress target directories
run: tar cf targets.tar testing/jvm/target noop/jvm/target docs/target target core/js/target testing/js/target noop/js/target core/jvm/target slf4j/target project/target
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
run: tar cf targets.tar testing/jvm/target noop/jvm/target target .js/target site/target core/js/target testing/js/target noop/js/target core/jvm/target .jvm/target .native/target slf4j/target project/target

- name: Upload target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
uses: actions/upload-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}
name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}-${{ matrix.project }}
path: targets.tar

publish:
Expand Down Expand Up @@ -121,151 +149,87 @@ jobs:
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Download target directories (2.13.8)
- name: Download target directories (2.13.8, rootJS)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-2.13.8-${{ matrix.java }}
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-rootJS

- name: Inflate target directories (2.13.8)
- name: Inflate target directories (2.13.8, rootJS)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.12.15)
- name: Download target directories (2.13.8, rootJVM)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-2.12.15-${{ matrix.java }}
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-rootJVM

- name: Inflate target directories (2.12.15)
- name: Inflate target directories (2.13.8, rootJVM)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (3.0.2)
- name: Download target directories (2.12.15, rootJS)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-3.0.2-${{ matrix.java }}
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.15-rootJS

- name: Inflate target directories (3.0.2)
- name: Inflate target directories (2.12.15, rootJS)
run: |
tar xf targets.tar
rm targets.tar
- name: Import signing key
run: echo $PGP_SECRET | base64 -d | gpg --import

- run: sbt ++${{ matrix.scala }} release

- if: matrix.scala == '2.12.15'
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6

- if: matrix.scala == '2.12.15'
run: gem update --system

- if: matrix.scala == '2.12.15'
run: gem install sass

- if: matrix.scala == '2.12.15'
run: gem install jekyll -v 4

- if: matrix.scala == '2.12.15'
run: sbt ++${{ matrix.scala }} docs/publishMicrosite

scalafmt:
name: Scalafmt
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.8, 2.12.15]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
- name: Download target directories (2.12.15, rootJVM)
uses: actions/download-artifact@v2
with:
fetch-depth: 0
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.15-rootJVM

- name: Setup Java (temurin@8)
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 8
- name: Inflate target directories (2.12.15, rootJVM)
run: |
tar xf targets.tar
rm targets.tar
- name: Setup Java (temurin@11)
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v2
- name: Download target directories (3.0.2, rootJS)
uses: actions/download-artifact@v2
with:
distribution: temurin
java-version: 11
name: target-${{ matrix.os }}-${{ matrix.java }}-3.0.2-rootJS

- name: Cache sbt
uses: actions/cache@v2
with:
path: |
~/.sbt
~/.ivy2/cache
~/.coursier/cache/v1
~/.cache/coursier/v1
~/AppData/Local/Coursier/Cache/v1
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Scalafmt
run: sbt ++${{ matrix.scala }} scalafmtCheckAll
- name: Inflate target directories (3.0.2, rootJS)
run: |
tar xf targets.tar
rm targets.tar
headers:
name: Headers
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.8, 2.12.15, 3.0.2]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
- name: Download target directories (3.0.2, rootJVM)
uses: actions/download-artifact@v2
with:
fetch-depth: 0
name: target-${{ matrix.os }}-${{ matrix.java }}-3.0.2-rootJVM

- name: Setup Java (temurin@8)
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 8
- name: Inflate target directories (3.0.2, rootJVM)
run: |
tar xf targets.tar
rm targets.tar
- name: Setup Java (temurin@11)
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 11
- name: Import signing key
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
run: echo $PGP_SECRET | base64 -d | gpg --import

- name: Cache sbt
uses: actions/cache@v2
with:
path: |
~/.sbt
~/.ivy2/cache
~/.coursier/cache/v1
~/.cache/coursier/v1
~/AppData/Local/Coursier/Cache/v1
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
- name: Import signing key and strip passphrase
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
run: |
echo "$PGP_SECRET" | base64 -d > /tmp/signing-key.gpg
echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
(echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1)
- name: Headers
run: sbt ++${{ matrix.scala }} headerCheckAll
- name: Publish
run: sbt '++${{ matrix.scala }}' tlRelease

microsite:
name: Microsite
site:
name: Generate Site
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.15]
java: [temurin@11]
scala: [3.0.2]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
Expand Down Expand Up @@ -299,15 +263,13 @@ jobs:
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6

- run: gem update --system
- name: Generate site
run: sbt '++${{ matrix.scala }}' docs/tlSite

- run: gem install sass

- run: gem install jekyll -v 4

- name: Build the microsite
run: sbt ++${{ matrix.scala }} docs/makeMicrosite
- name: Publish site
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v')
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: site/target/docs/site
publish_branch: gh-pages
5 changes: 5 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,8 @@ rewrite {
}

runner.dialect = "scala213source3"
fileOverride {
"glob:**/scala-3/**" {
runner.dialect = scala3
}
}
Loading

0 comments on commit b730526

Please sign in to comment.