forked from iandebeer/castanet
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (48 loc) · 1.27 KB
/
continuous-integration.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
49
50
51
52
53
54
55
56
57
name: Continuous Integration
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
name: Test
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
cache: sbt
- run: sudo apt-get update && sudo apt-get install -y graphviz
- name: Check formatting with Scalafmt
run: sbt scalafmtCheckAll
- name: Check import organization with Scalafix
run: sbt "scalafix --check OrganizeImports"
- name: Run SBT test
run: sbt test
publish:
name: Publish
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')
permissions:
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
cache: sbt
- run: sbt publish
env:
GITHUB_TOKEN: ${{ github.token }}
GITHUB_OWNER: ${{ github.repository_owner }}
GITHUB_REPO: ${{ github.event.repository.name }}