-
Notifications
You must be signed in to change notification settings - Fork 121
92 lines (90 loc) · 3.06 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
81
82
83
84
85
86
87
88
89
90
91
92
name: CI
on:
pull_request:
push:
jobs:
test:
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
java: [ 8, 11, 17, 21 ]
distribution: [ temurin ]
exclude:
# Exclude JDK 8 on macOS as GitHub Actions do not support it
- os: macos-latest
java: 8
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}
cache: sbt
- name: Setup SBT
uses: sbt/setup-sbt@v1
- name: Build and test (1)
shell: bash
run: bin/run-ci.sh
format-and-benchmark:
timeout-minutes: 25
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
jobtype: [ 3, 4, 5, 6 ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: sbt
- name: Setup SBT
uses: sbt/setup-sbt@v1
- name: Build and test (3)
if: ${{ matrix.jobtype == 3 }}
shell: bash
run: |
sbt -v -Dfile.encoding=UTF-8 scalafmtCheckAll scalafmtSbtCheck
- name: Benchmark (Scalac) (4)
if: ${{ matrix.jobtype == 4 }}
shell: bash
run: |
sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*Scalac.*" "runBenchmarks"
- name: Benchmark (Shapeless) (5)
if: ${{ matrix.jobtype == 5 }}
shell: bash
run: |
sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*Shapeless.*" "runBenchmarks"
- name: Benchmark (AnalysisFormatBenchmark) (6)
if: ${{ matrix.jobtype == 6 }}
shell: bash
run: |
sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*AnalysisFormatBenchmark.*" "runBenchmarks"
- name: Checkout Target Branch (4-6)
if: ${{ github.event_name == 'pull_request' && (matrix.jobtype >= 4 && matrix.jobtype <= 6) }}
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}
- name: Benchmark (Scalac) against Target Branch (4)
if: ${{ github.event_name == 'pull_request' && matrix.jobtype == 4 }}
shell: bash
run: |
sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*Scalac.*" "runBenchmarks"
- name: Benchmark (Shapeless) against Target Branch (5)
if: ${{ github.event_name == 'pull_request' && matrix.jobtype == 5 }}
shell: bash
run: |
sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*Shapeless.*" "runBenchmarks"
- name: Benchmark (AnalysisFormatBenchmark) against Target Branch (6)
if: ${{ github.event_name == 'pull_request' && matrix.jobtype == 6 }}
shell: bash
run: |
sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*AnalysisFormatBenchmark.*" "runBenchmarks"