Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to sbt-typelevel #592

Merged
merged 6 commits into from
Jan 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
226 changes: 94 additions & 132 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,27 +71,46 @@ 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') || github.ref == 'refs/heads/main')
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') || github.ref == 'refs/heads/main')
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') || github.ref == 'refs/heads/main')
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:
name: Publish Artifacts
needs: [build]
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
strategy:
matrix:
os: [ubuntu-latest]
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' && github.ref == 'refs/heads/main'
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