-
-
Notifications
You must be signed in to change notification settings - Fork 52
80 lines (76 loc) · 2.09 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v3
with:
java-version: 8
distribution: adopt
- name: Mount caches
uses: actions/cache@v2
with:
path: |
~/.sbt
~/.ivy2/cache
~/.cache/coursier
key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}
- name: Remove native tests (Windows only)
if: ${{ runner.os == 'Windows' }}
run: |
rm -rf examples/scalapb-crossproject
shell: bash
- name: Compile and test
run: |
sbt test
cd examples
for d in */ ; do cd "$d" && sbt test && cd ../ ; done
shell: bash
- name: Format check
if: ${{ runner.os == 'Linux' }}
run: |
sbt scalafmtCheck test:scalafmtCheck scalafmtSbtCheck
scripted:
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
scripted-sbt: ["1.2.8", "1.3.13", "project"]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v3
with:
java-version: 11
distribution: adopt
- name: Mount caches
uses: actions/cache@v2
with:
path: |
~/.sbt
~/.ivy2/cache
~/.cache/coursier
key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}
- name: Compile and run scripted tests with older version
if: ${{ matrix.scripted-sbt != 'project' }}
env:
SCRIPTED_SBT: ${{ matrix.scripted-sbt }}
run: |
sbt "set scriptedSbt := \"$SCRIPTED_SBT\"" scripted
shell: bash
- name: Compile and run scripted tests with project version
if: ${{ matrix.scripted-sbt == 'project' }}
run: |
sbt "set scriptedSbt := sbtVersion.value" scripted
shell: bash
# Single final job for mergify.
ci-passed:
runs-on: ubuntu-latest
needs: [build, scripted]
steps:
- run: ':'