-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #386 from davenverse/switchBuild
Switch build
- Loading branch information
Showing
4 changed files
with
162 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,12 +9,17 @@ name: Continuous Integration | |
|
||
on: | ||
pull_request: | ||
branches: ['**'] | ||
branches: ['**', '!update/**', '!pr/**'] | ||
push: | ||
branches: ['**'] | ||
branches: ['**', '!update/**', '!pr/**'] | ||
tags: [v*] | ||
|
||
env: | ||
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }} | ||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
PGP_SECRET: ${{ secrets.PGP_SECRET }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
|
@@ -24,18 +29,30 @@ jobs: | |
matrix: | ||
os: [ubuntu-latest] | ||
scala: [2.12.15, 2.13.8, 3.1.2] | ||
java: [[email protected], [email protected]] | ||
java: [temurin@8] | ||
project: [rootJS, rootJVM] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout current branch (full) | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Java and Scala | ||
uses: olafurpg/setup-scala@v12 | ||
- name: Download Java (temurin@8) | ||
id: download-java-temurin-8 | ||
if: matrix.java == 'temurin@8' | ||
uses: typelevel/download-java@v1 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
distribution: temurin | ||
java-version: 8 | ||
|
||
- name: Setup Java (temurin@8) | ||
if: matrix.java == 'temurin@8' | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: jdkfile | ||
java-version: 8 | ||
jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }} | ||
|
||
- name: Cache sbt | ||
uses: actions/cache@v2 | ||
|
@@ -50,9 +67,37 @@ jobs: | |
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} | ||
|
||
- name: Check that workflows are up to date | ||
run: sbt --client '++${{ matrix.scala }}; githubWorkflowCheck' | ||
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' 'project /' githubWorkflowCheck | ||
|
||
- name: scalaJSLink | ||
if: matrix.project == 'rootJS' | ||
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' Test/scalaJSLinkerResult | ||
|
||
- name: Test | ||
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' test | ||
|
||
- run: sbt --client '++${{ matrix.scala }}; test; 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 modules/noop/.jvm/target target .js/target modules/caffeine/target modules/core/.js/target modules/noop/.js/target modules/core/.jvm/target .jvm/target .native/target modules/reload/.js/target modules/reload/.jvm/target modules/bench/target project/target | ||
|
||
- name: Compress target directories | ||
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') | ||
run: tar cf targets.tar modules/noop/.jvm/target target .js/target modules/caffeine/target modules/core/.js/target modules/noop/.js/target modules/core/.jvm/target .jvm/target .native/target modules/reload/.js/target modules/reload/.jvm/target modules/bench/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.java }}-${{ matrix.scala }}-${{ matrix.project }} | ||
path: targets.tar | ||
|
||
publish: | ||
name: Publish Artifacts | ||
|
@@ -62,18 +107,29 @@ jobs: | |
matrix: | ||
os: [ubuntu-latest] | ||
scala: [3.1.2] | ||
java: [adopt@1.8] | ||
java: [temurin@8] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout current branch (full) | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Java and Scala | ||
uses: olafurpg/setup-scala@v12 | ||
- name: Download Java (temurin@8) | ||
id: download-java-temurin-8 | ||
if: matrix.java == 'temurin@8' | ||
uses: typelevel/download-java@v1 | ||
with: | ||
distribution: temurin | ||
java-version: 8 | ||
|
||
- name: Setup Java (temurin@8) | ||
if: matrix.java == 'temurin@8' | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
distribution: jdkfile | ||
java-version: 8 | ||
jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }} | ||
|
||
- name: Cache sbt | ||
uses: actions/cache@v2 | ||
|
@@ -87,12 +143,76 @@ jobs: | |
~/Library/Caches/Coursier/v1 | ||
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} | ||
|
||
- uses: olafurpg/setup-gpg@v3 | ||
- name: Download target directories (2.12.15, rootJS) | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.15-rootJS | ||
|
||
- name: Inflate target directories (2.12.15, rootJS) | ||
run: | | ||
tar xf targets.tar | ||
rm targets.tar | ||
- name: Download target directories (2.12.15, rootJVM) | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.15-rootJVM | ||
|
||
- name: Inflate target directories (2.12.15, rootJVM) | ||
run: | | ||
tar xf targets.tar | ||
rm targets.tar | ||
- name: Download target directories (2.13.8, rootJS) | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-rootJS | ||
|
||
- name: Inflate target directories (2.13.8, rootJS) | ||
run: | | ||
tar xf targets.tar | ||
rm targets.tar | ||
- name: Download target directories (2.13.8, rootJVM) | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-rootJVM | ||
|
||
- name: Inflate target directories (2.13.8, rootJVM) | ||
run: | | ||
tar xf targets.tar | ||
rm targets.tar | ||
- name: Download target directories (3.1.2, rootJS) | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.2-rootJS | ||
|
||
- name: Inflate target directories (3.1.2, rootJS) | ||
run: | | ||
tar xf targets.tar | ||
rm targets.tar | ||
- name: Download target directories (3.1.2, rootJVM) | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.2-rootJVM | ||
|
||
- name: Inflate target directories (3.1.2, rootJVM) | ||
run: | | ||
tar xf targets.tar | ||
rm targets.tar | ||
- name: Import signing key | ||
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == '' | ||
run: echo $PGP_SECRET | base64 -di | gpg --import | ||
|
||
- name: Import signing key and strip passphrase | ||
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != '' | ||
run: | | ||
echo "$PGP_SECRET" | base64 -di > /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: Publish artifacts to Sonatype | ||
env: | ||
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | ||
PGP_SECRET: ${{ secrets.PGP_SECRET }} | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
run: sbt --client '++${{ matrix.scala }}; ci-release' | ||
- name: Publish | ||
run: sbt '++${{ matrix.scala }}' tlRelease |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.3.1") | ||
addSbtPlugin("io.chrisdavenport" % "sbt-davenverse" % "0.1.4") | ||
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3") | ||
addSbtPlugin("org.typelevel" % "sbt-typelevel-ci-release" % "0.4.12") | ||
addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % "0.4.12") | ||
addSbtPlugin("org.typelevel" % "sbt-typelevel-settings" % "0.4.12") | ||
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.0") | ||
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.2.0") | ||
|