Skip to content

Commit

Permalink
build: replace travis with github actions (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrudolph authored Jul 15, 2021
1 parent 3c7369b commit 80afc1b
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 125 deletions.
101 changes: 101 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Test and publish

on:
pull_request:
push:
branches: [ main ]
tags: [ v* ]

jobs:
compile-and-test:
name: Compile and test and publish
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
scala-version:
- 2.11.6
- 2.11.7
- 2.11.8
- 2.11.11
- 2.11.12
- 2.12.3
- 2.12.4
- 2.12.5
- 2.12.6
- 2.12.7
- 2.12.8
- 2.12.9
- 2.12.10
- 2.12.11
- 2.12.12
- 2.12.13
- 2.12.14
- 2.13.0
- 2.13.1
- 2.13.2
- 2.13.3
- 2.13.4
- 2.13.5
- 2.13.6
jdk-version: [1.8, 1.11]
# some old scala versions don't support JDK 11
exclude:
- scala-version: 2.11.6
jdk-version: 1.11
- scala-version: 2.11.7
jdk-version: 1.11
- scala-version: 2.11.8
jdk-version: 1.11
- scala-version: 2.11.11
jdk-version: 1.11

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Checkout GitHub merge
if: github.event.pull_request
run: |-
git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch
git checkout scratch
- name: Set up JDK ${{ matrix.jdk-version }}
uses: olafurpg/setup-scala@v10
with:
java-version: adopt@${{ matrix.jdk-version }}

- name: Cache Coursier cache
uses: coursier/cache-action@v5

- name: Compile and test for JDK ${{ matrix.jdk-version }}, Scala ${{ matrix.scala-version }}
run: sbt -J-XX:ReservedCodeCacheSize=256M ++${{ matrix.scala-version }} test

publish:
name: Publish to Maven Central
if: startsWith(github.ref, 'refs/tags/v')
needs: [ compile-and-test ]
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up JDK 8
uses: olafurpg/setup-scala@v10
with:
java-version: adopt@1.8

- name: Cache Coursier cache
uses: coursier/cache-action@v5

- name: Publish
run: sbt ci-release
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
125 changes: 0 additions & 125 deletions .travis.yml

This file was deleted.

0 comments on commit 80afc1b

Please sign in to comment.