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

View File

@@ -1,17 +0,0 @@
language: scala
sudo: true
jdk:
- openjdk8
- openjdk11
script:
- sbt scalafmtSbtCheck scalafmtCheck test:scalafmtCheck test
before_script:
- sudo /etc/init.d/mysql stop
- sudo /etc/init.d/postgresql stop
- sudo chmod +x /usr/local/bin/sbt
cache:
directories:
- $HOME/.ivy2/cache
- $HOME/.sbt/boot
- $HOME/.sbt/launchers
- $HOME/.coursier