Skip to content

Commit 0055ba3

Browse files
authored
Merge pull request #278 from scala/sbt-scala-module-3
replace Travis-CI with GitHub Actions
2 parents 6f03ac0 + b6ee218 commit 0055ba3

File tree

12 files changed

+78
-103
lines changed

12 files changed

+78
-103
lines changed

Diff for: .github/workflows/ci.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: test
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
jobs:
8+
test:
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
java: [8, 11, 17-ea]
13+
scala: [2.12.14, 2.13.6]
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: coursier/cache-action@v6
18+
- uses: actions/setup-java@v2
19+
with:
20+
distribution: adopt
21+
java-version: ${{matrix.java}}
22+
- name: Test
23+
run: sbt ++${{matrix.scala}} test proj/headerCheck package

Diff for: .github/workflows/release.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Release
2+
on:
3+
push:
4+
tags: ["*"]
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
with:
11+
fetch-depth: 0
12+
- uses: actions/setup-java@v2
13+
with:
14+
distribution: adopt
15+
java-version: 8
16+
- run: sbt versionCheck ci-release
17+
env:
18+
PGP_PASSPHRASE: ${{secrets.PGP_PASSPHRASE}}
19+
PGP_SECRET: ${{secrets.PGP_SECRET}}
20+
SONATYPE_PASSWORD: ${{secrets.SONATYPE_PASSWORD}}
21+
SONATYPE_USERNAME: ${{secrets.SONATYPE_USERNAME}}

Diff for: .travis.yml

-24
This file was deleted.

Diff for: README.md

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
# scala-async [![Build Status](https://travis-ci.org/scala/scala-async.svg?branch=master)](https://travis-ci.org/scala/scala-async) [<img src="https://img.shields.io/maven-central/v/org.scala-lang.modules/scala-async_2.12.svg?label=latest%20release%20for%202.12">](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.scala-lang.modules%20a%3Ascala-async_2.12) [<img src="https://img.shields.io/maven-central/v/org.scala-lang.modules/scala-async_2.13.svg?label=latest%20release%20for%202.13">](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.scala-lang.modules%20a%3Ascala-async_2.13)
1+
# scala-async [<img src="https://img.shields.io/maven-central/v/org.scala-lang.modules/scala-async_2.12.svg?label=latest%20release%20for%202.12">](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.scala-lang.modules%20a%3Ascala-async_2.12) [<img src="https://img.shields.io/maven-central/v/org.scala-lang.modules/scala-async_2.13.svg?label=latest%20release%20for%202.13">](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.scala-lang.modules%20a%3Ascala-async_2.13)
22

3-
A DSL to enable a direct style of programming with when composing values wrapped in Scala `Future`s.
3+
A Scala DSL to enable a direct style of coding when composing `Future`s.
44

5-
## Quick start
6-
7-
To include scala-async in an existing project use the library published on Maven Central.
8-
For sbt projects add the following to your build definition - build.sbt or project/Build.scala:
9-
10-
### Use a modern Scala compiler
5+
## Usage
116

127
As of scala-async 1.0, Scala 2.12.12+ or 2.13.3+ are required.
138

@@ -44,6 +39,7 @@ to match your project’s Scala binary version):
4439
Add the `-Xasync` to the Scala compiler options.
4540

4641
#### SBT Example
42+
4743
```scala
4844
scalacOptions += "-Xasync"
4945
```
@@ -133,7 +129,7 @@ def combined: Future[Int] = async {
133129

134130
### `await` must be directly in the control flow of the async expression
135131

136-
The `await` cannot be nested under a local method, object, class or lambda:
132+
The `await` cannot be nested under a local method, object, class or lambda:
137133

138134
```
139135
async {

Diff for: build.sbt

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
val sharedSettings = ScalaModulePlugin.scalaModuleSettings ++ ScalaModulePlugin.scalaModuleOsgiSettings ++ Seq(
22
name := "scala-async",
33
scalaModuleAutomaticModuleName := Some("scala.async"),
4-
versionPolicyIntention := Compatibility.BinaryAndSourceCompatible,
4+
5+
crossScalaVersions := Seq("2.13.6", "2.12.14"),
6+
scalaVersion := crossScalaVersions.value.head,
57

68
OsgiKeys.exportPackage := Seq(s"scala.async.*;version=${version.value}"),
79

@@ -12,16 +14,23 @@ val sharedSettings = ScalaModulePlugin.scalaModuleSettings ++ ScalaModulePlugin.
1214
ScalaModulePlugin.enableOptimizer,
1315
testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "-v", "-s"),
1416
Test / scalacOptions ++= Seq("-Yrangepos"),
15-
scalacOptions ++= List("-deprecation" , "-Xasync")
17+
scalacOptions ++= List("-deprecation" , "-Xasync"),
1618
)
1719

1820
lazy val proj = crossProject(JSPlatform, JVMPlatform)
1921
.withoutSuffixFor(JVMPlatform)
2022
.crossType(CrossType.Pure)
2123
.in(file("."))
2224
.settings(sharedSettings)
25+
// until we have actually published for Scala.js
26+
.jvmSettings(versionPolicyIntention := Compatibility.BinaryAndSourceCompatible)
27+
.jsSettings(versionPolicyIntention := Compatibility.None)
28+
// override sbt-scala-module default (which is unsuitable for Scala.js)
29+
.jsSettings(Test / fork := false)
2330

24-
lazy val root = project.in(file(".")).settings(sharedSettings)
31+
lazy val root = project.in(file("."))
32+
.settings(sharedSettings)
33+
.aggregate(proj.jvm, proj.js)
2534

2635
Global / parallelExecution := false
2736

Diff for: build.sh

-66
This file was deleted.

Diff for: project/plugins.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.4.0")
1+
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "3.0.0")
22
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.0")
33
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0")

Diff for: src/main/scala/scala/async/FutureStateMachine.scala

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* See the NOTICE file distributed with this work for
1010
* additional information regarding copyright ownership.
1111
*/
12+
1213
package scala.async
1314

1415
import java.util.Objects

Diff for: src/test/scala/scala/async/ExceptionalTest.scala

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
/*
2+
* Scala (https://www.scala-lang.org)
3+
*
4+
* Copyright EPFL and Lightbend, Inc.
5+
*
6+
* Licensed under Apache License 2.0
7+
* (http://www.apache.org/licenses/LICENSE-2.0).
8+
*
9+
* See the NOTICE file distributed with this work for
10+
* additional information regarding copyright ownership.
11+
*/
12+
113
package scala.async
214

315
import java.util.concurrent.atomic.AtomicReference

Diff for: src/test/scala/scala/async/FutureSpec.scala

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* See the NOTICE file distributed with this work for
1010
* additional information regarding copyright ownership.
1111
*/
12+
1213
package scala.async
1314

1415
import java.util.concurrent.ConcurrentHashMap

Diff for: src/test/scala/scala/async/SmokeTest.scala

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* See the NOTICE file distributed with this work for
1010
* additional information regarding copyright ownership.
1111
*/
12+
1213
package scala.async
1314

1415
import org.junit.{Assert, Test}

Diff for: src/test/scala/scala/async/TestUtil.scala

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* See the NOTICE file distributed with this work for
1010
* additional information regarding copyright ownership.
1111
*/
12+
1213
package scala.async
1314

1415
import java.util.concurrent.{CountDownLatch, TimeUnit}

0 commit comments

Comments
 (0)