Skip to content

Commit

Permalink
Merge pull request #53 from Kevin-Lee/github-actions-use-matrix-for-c…
Browse files Browse the repository at this point in the history
…ross-scala-versions

Changed: GitHub Actions - Cross Scala version build using matrix
  • Loading branch information
kevin-lee committed Jan 14, 2020
2 parents 658541b + c72bd4a commit ea140da
Showing 1 changed file with 13 additions and 52 deletions.
65 changes: 13 additions & 52 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,77 +4,38 @@ on: [push]

jobs:

build_scala2_10:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Cache Coursier
uses: actions/cache@v1
with:
path: ~/.cache/coursier
key: ${{ runner.os }}-coursier-scala-2_10-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }}
restore-keys: |
${{ runner.os }}-coursier-scala-2_10-

- name: Cache Ivy
uses: actions/cache@v1
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-ivy-scala-2_10-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }}
restore-keys: |
${{ runner.os }}-ivy-scala-2_10-
- name: Build for Scala 2.10
run: .github/workflows/sbt-build-simple.sh 2.10.7
strategy:
matrix:
scala:
- { version: "2.10.7", binary-version: "2.10" }
- { version: "2.11.12", binary-version: "2.11" }
- { version: "2.12.10", binary-version: "2.12" }

build_scala2_11:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Cache Coursier
uses: actions/cache@v1
with:
path: ~/.cache/coursier
key: ${{ runner.os }}-coursier-scala-2_11-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }}
key: ${{ runner.os }}-coursier-scala-${{ matrix.scala.binary-version }}-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }}
restore-keys: |
${{ runner.os }}-coursier-scala-2_11-
${{ runner.os }}-coursier-scala-${{ matrix.scala.binary-version }}-
- name: Cache Ivy
uses: actions/cache@v1
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-ivy-scala-2_11-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }}
key: ${{ runner.os }}-ivy-scala-${{ matrix.scala.binary-version }}-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }}
restore-keys: |
${{ runner.os }}-ivy-scala-2_11-
- name: Build for Scala 2.11
run: .github/workflows/sbt-build-simple.sh 2.11.12
${{ runner.os }}-ivy-scala-${{ matrix.scala.binary-version }}-
build_scala2_12:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Cache Coursier
uses: actions/cache@v1
with:
path: ~/.cache/coursier
key: ${{ runner.os }}-coursier-scala-2_12-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }}
restore-keys: |
${{ runner.os }}-coursier-scala-2_12-
- name: Cache Ivy
uses: actions/cache@v1
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-ivy-scala-2_12-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }}
restore-keys: |
${{ runner.os }}-ivy-scala-2_12-
- name: Build for Scala ${{ matrix.scala.version }}
run: .github/workflows/sbt-build-simple.sh ${{ matrix.scala.version }}

- name: Build for Scala 2.12
run: .github/workflows/sbt-build-simple.sh 2.12.10

build_scala2_13:
runs-on: ubuntu-latest
Expand Down

0 comments on commit ea140da

Please sign in to comment.