Skip to content

Commit

Permalink
Switch to GitHub actions (#455)
Browse files Browse the repository at this point in the history
Switch to GitHub actions (update badge in README)

Co-authored-by: Sergey Morgunov <hostage@me.com>
  • Loading branch information
mkurz and ihostage authored May 13, 2022
1 parent 1f1c4a8 commit f04eb39
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 208 deletions.
14 changes: 0 additions & 14 deletions .ci_scripts/jvmopts.sh

This file was deleted.

24 changes: 0 additions & 24 deletions .ci_scripts/validate.sh

This file was deleted.

156 changes: 0 additions & 156 deletions .circleci/config.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Check

on:
pull_request:

concurrency:
# Only run once for latest commit per ref and cancel other (previous) runs.
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
check-code-style:
name: Code Style
uses: playframework/.github/.github/workflows/cmd.yml@v2
with:
cmd: sbt validateCode

check-binary-compatibility:
name: Binary Compatibility
uses: playframework/.github/.github/workflows/binary-check.yml@v2

check-docs:
name: Docs
uses: playframework/.github/.github/workflows/cmd.yml@v2
with:
java: 11, 8
scala: 2.11.12, 2.12.15, 2.13.8
cmd: sbt ++$MATRIX_SCALA docs/test

tests:
name: Tests
needs: # Waiting more lightweight checks
- "check-code-style"
- "check-binary-compatibility"
- "check-docs"
uses: playframework/.github/.github/workflows/cmd.yml@v2
with:
java: 11, 8
scala: 2.11.12, 2.12.15, 2.13.8
cmd: sbt ++$MATRIX_SCALA publishLocal test # scapegoat

finish:
name: Finish
needs: # Should be last
- "tests"
uses: playframework/.github/.github/workflows/rtm.yml@v2
13 changes: 13 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Publish

on:
push:
branches: # Snapshots
- main
tags: ["*"] # Releases

jobs:
publish-artifacts:
name: Publish / Artifacts
uses: playframework/.github/.github/workflows/publish.yml@v2
secrets: inherit
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Anorm

[![Build Status](https://github.com/playframework/anorm/actions/workflows/build-test.yml/badge.svg)](https://github.com/playframework/anorm/actions/workflows/build-test.yml)

Anorm is a simple data access layer that uses plain SQL to interact with the database and provides an API to parse and transform the resulting datasets.

- [User guide](https://playframework.github.io/anorm/)
Expand All @@ -24,8 +26,6 @@ To run the tests, use:

sbt test

[CircleCI](https://circleci.com/gh/playframework/anorm): ![CircleCI build status](https://circleci.com/gh/playframework/anorm.png?branch=main)

## Documentation

To run the documentation server, run:
Expand Down
10 changes: 0 additions & 10 deletions bin/travis

This file was deleted.

8 changes: 8 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -303,3 +303,11 @@ lazy val docs = project
Scapegoat.settings

ThisBuild / playBuildRepoName := "anorm"

addCommandAlias(
"validateCode",
List(
"scalafmtSbtCheck",
"scalafmtCheckAll",
).mkString(";")
)
4 changes: 2 additions & 2 deletions core/src/test/scala/anorm/AnormSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,9 @@ final class AnormSpec extends Specification with H2Database with AnormTest {
) { implicit c =>

SQL("SELECT * FROM test")
.as((SqlParser.int("id") ~ SqlParser.str("val").?).map({ case id ~ v =>
.as((SqlParser.int("id") ~ SqlParser.str("val").?).map { case id ~ v =>
(id -> v)
} *))
} *)
.aka("parsed list") must_=== List(9 -> None, 2 -> Some("str"))
}

Expand Down

0 comments on commit f04eb39

Please sign in to comment.