Setup GitHub Actions workflow (#2476)

This commit is contained in:
Naoki Takezoe
2020-07-05 11:30:32 +09:00
committed by GitHub
parent 5d77bc5d98
commit 8cf4528959
2 changed files with 40 additions and 17 deletions

40
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: Scala CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [8, 11]
steps:
- uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v2
env:
cache-name: cache-sbt-libs
with:
path: |
~/.ivy2/cache
~/.sbt
~/.coursier
key: build-${{ env.cache-name }}-${{ hashFiles('build.sbt') }}
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Run tests
run: sbt scalafmtSbtCheck scalafmtCheck test:scalafmtCheck test
- name: Build executable
run: sbt executable
- name: Upload artifact
uses: actions/upload-artifact@v2
if: ${{ matrix.java == 8 }}
with:
name: gitbucket.war
path: ./target/executable/gitbucket.war