Skip to content

Commit

Permalink
Scala-JS CI + Publish (#86)
Browse files Browse the repository at this point in the history
* Attempt to publish js snapshots

* Added a ci release command for scala-js, here goes nothing!

* Moved the release command into its own phase

* Fixed the release.yaml

* Added unit testing for scala-js

* Removed branch release
  • Loading branch information
j-mie6 authored Mar 7, 2021
1 parent 9025246 commit 6894687
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 8 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,61 @@ jobs:
#if: needs.check-duplicate.outputs.should_skip != 'true'
run: sbt ++$SCALA_VERSION doc

# This is largely temporary, we'll find a better way to do this...
validate-js:
name: Scala-JS ${{ matrix.scala }}, Node ${{ matrix.node }}
runs-on: ubuntu-20.04
needs: check-duplicate

env:
SCALA_VERSION: ${{ matrix.scala }}

strategy:
fail-fast: false
matrix:
node: [14, 15]
scala: [2.12.13, 2.13.5]

steps:
- name: Checkout repository
#if: needs.check-duplicate.outputs.should_skip != 'true'
uses: actions/[email protected]

- name: Setup Node
#if: needs.check-duplicate.outputs.should_skip != 'true'
uses: actions/[email protected]
with:
node-version: ${{ matrix.node }}

- name: Setup Scala
#if: needs.check-duplicate.outputs.should_skip != 'true'
uses: olafurpg/setup-scala@v10
with:
java-version: [email protected]

- name: Cache Coursier
#if: needs.check-duplicate.outputs.should_skip != 'true'
uses: actions/cache@v2
with:
path: ~/.cache/coursier
key: sbt-coursier-cache

- name: Cache SBT
#if: needs.check-duplicate.outputs.should_skip != 'true'
uses: actions/cache@v2
with:
path: ~/.sbt
key: sbt-${{ hashFiles('**/build.sbt') }}

- name: Test
#if: needs.check-duplicate.outputs.should_skip != 'true'
run: sbt ++$SCALA_VERSION parsleyJS/test

- name: Scaladoc
#if: needs.check-duplicate.outputs.should_skip != 'true'
run: sbt ++$SCALA_VERSION parsleyJS/doc
# End attrocity

coverage:
name: Test Coverage
runs-on: ubuntu-20.04
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ on:
- '*'
workflow_dispatch:

#env:
# WARN: Updating sbt ci-release to any version past 1.5.4 changes the default (+publishSigned) to +publish
# CI_SNAPSHOT_RELEASE: +publishSigned
# Temp: testing if SCALA_VERSION is needed
# SCALA_VERSION: 2.12.13

jobs:
release:
name: Release
Expand Down Expand Up @@ -43,9 +37,21 @@ jobs:
path: ~/.sbt
key: sbt-${{ hashFiles('**/build.sbt') }}

- name: Publish
- name: Publish JVM
run: sbt ci-release
env:
CI_RELEASE: +publishSigned
CI_SNAPSHOT_RELEASE: +publishSigned
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

- name: Publish JS
run: sbt ci-release
env:
CI_RELEASE: +parsleyJS/publishSigned
CI_SNAPSHOT_RELEASE: +parsleyJS/publishSigned
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
Expand Down
7 changes: 6 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ lazy val parsley = crossProject(JSPlatform, JVMPlatform)

libraryDependencies += "org.scalatest" %%% "scalatest" % scalaTestDependency(scalaVersion.value) % Test,

crossScalaVersions := List(scala212Version, scala213Version, scala3Version, dottyVersion),
// temporary until Parsley 3.0
Compile / unmanagedSourceDirectories += file(s"${baseDirectory.value.getParentFile.getPath}/src/main/deprecated"),
Compile / unmanagedSourceDirectories ++= extraSources(baseDirectory.value.getParentFile, "main", scalaVersion.value),
Expand All @@ -84,3 +83,9 @@ lazy val parsley = crossProject(JSPlatform, JVMPlatform)
if (scalaVersion.value == dottyVersion) Seq() else old
}
)
.jvmSettings(
crossScalaVersions := List(scala212Version, scala213Version, scala3Version, dottyVersion),
)
.jsSettings(
crossScalaVersions := List(scala212Version, scala213Version)
)

0 comments on commit 6894687

Please sign in to comment.