-
Notifications
You must be signed in to change notification settings - Fork 7
48 lines (47 loc) · 1.4 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: CI
on:
pull_request:
push:
branches:
- main
jobs:
format:
runs-on: ubuntu-latest
permissions:
contents: write
if: ${{ github.event_name == 'push' || github.event.pull_request.user.login == 'windymelt' }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
cache: 'sbt'
- name: Install sbt
run: curl -Ls https://raw.githubusercontent.com/dwijnand/sbt-extras/master/sbt > /bin/sbt && chmod 0755 /bin/sbt
- uses: coursier/cache-action@v6
- name: sbt scalafmtAll
run: /bin/sbt scalafmtAll
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply scalafmt
build-test:
runs-on: ubuntu-latest
strategy:
matrix:
java-distribution: [ 'temurin' ]
java-version: [ '17' ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: ${{ matrix.java-distribution }}
java-version: ${{ matrix.java-version }}
cache: 'sbt'
- name: Install sbt
run: curl -Ls https://raw.githubusercontent.com/dwijnand/sbt-extras/master/sbt > /bin/sbt && chmod 0755 /bin/sbt
- uses: coursier/cache-action@v6
- name: Test
run: /bin/sbt test