Skip to content

Commit 4be49cd

Browse files
authored
Modernize CI (#602)
1 parent de1b2fc commit 4be49cd

File tree

2 files changed

+82
-35
lines changed

2 files changed

+82
-35
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 76 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: CI
22

33
env:
4-
JDK_JAVA_OPTIONS: -XX:+PrintCommandLineFlags # JDK_JAVA_OPTIONS is _the_ env. variable to use for modern Java
5-
JVM_OPTS: -XX:+PrintCommandLineFlags # for Java 8 only (sadly, it is not modern enough for JDK_JAVA_OPTIONS)
4+
JDK_JAVA_OPTIONS: -XX:+PrintCommandLineFlags -Xms2G -Xmx8G -Xss4M -XX:+UseG1GC -XX:ReservedCodeCacheSize=512M -XX:NonProfiledCodeHeapSize=256M # JDK_JAVA_OPTIONS is _the_ env. variable to use for modern Java
5+
SBT_OPTS: -XX:+PrintCommandLineFlags -Xms2G -Xmx8G -Xss4M -XX:+UseG1GC -XX:ReservedCodeCacheSize=512M -XX:NonProfiledCodeHeapSize=256M # Needed for sbt
66

77
on:
88
pull_request:
@@ -18,16 +18,19 @@ jobs:
1818
timeout-minutes: 30
1919
steps:
2020
- name: Checkout current branch
21-
uses: actions/checkout@v4.1.1
21+
uses: actions/checkout@v6
2222
with:
2323
fetch-depth: 0
24-
- name: Cache scala dependencies
25-
uses: coursier/cache-action@v6
26-
- name: Setup Action
27-
uses: coursier/setup-action@v1
24+
- name: Setup Java
25+
uses: actions/setup-java@v5
2826
with:
29-
jvm: temurin:21
30-
apps: sbt
27+
distribution: corretto
28+
java-version: 17
29+
check-latest: true
30+
- name: Setup sbt
31+
uses: sbt/setup-sbt@v1
32+
- name: Cache scala dependencies
33+
uses: coursier/cache-action@v7
3134
- name: Lint code
3235
run: sbt check
3336

@@ -36,38 +39,44 @@ jobs:
3639
timeout-minutes: 60
3740
steps:
3841
- name: Checkout current branch
39-
uses: actions/checkout@v4.1.1
40-
- name: Cache scala dependencies
41-
uses: coursier/cache-action@v6
42-
- name: Setup Action
43-
uses: coursier/setup-action@v1
42+
uses: actions/checkout@v6
43+
- name: Setup Java
44+
uses: actions/setup-java@v5
4445
with:
45-
jvm: temurin:21
46-
apps: sbt
46+
distribution: corretto
47+
java-version: 17
48+
check-latest: true
49+
- name: Setup sbt
50+
uses: sbt/setup-sbt@v1
51+
- name: Cache scala dependencies
52+
uses: coursier/cache-action@v7
4753
- name: Check Document Generation
4854
run: sbt docs/compileDocs
4955

50-
test:
56+
test_scala:
5157
runs-on: ubuntu-latest
5258
timeout-minutes: 30
5359
strategy:
5460
fail-fast: false
5561
matrix:
56-
java: ['11', '17', '21']
57-
scala: ['2.12.21', '2.13.16', '3.3.3']
62+
java: ['17']
63+
scala: ['2.12.x', '2.13.x', '3.x']
5864
platform: ['JVM', 'Native', 'JS']
5965
steps:
6066
- name: Checkout current branch
61-
uses: actions/checkout@v4.1.1
67+
uses: actions/checkout@v6
6268
with:
6369
fetch-depth: 0
64-
- name: Cache scala dependencies
65-
uses: coursier/cache-action@v6
66-
- name: Setup Action
67-
uses: coursier/setup-action@v1
70+
- name: Setup Java
71+
uses: actions/setup-java@v5
6872
with:
69-
jvm: temurin:${{ matrix.java }}
70-
apps: sbt
73+
distribution: corretto
74+
java-version: ${{ matrix.java }}
75+
check-latest: true
76+
- name: Setup sbt
77+
uses: sbt/setup-sbt@v1
78+
- name: Cache scala dependencies
79+
uses: coursier/cache-action@v7
7180
- name: Install libuv
7281
if: matrix.platform == 'Native'
7382
run: sudo apt-get update && sudo apt-get install -y libuv1-dev
@@ -77,11 +86,40 @@ jobs:
7786
with:
7887
node-version: 21.6.1
7988
- name: Run tests
80-
run: sbt ++${{ matrix.scala }} zioProcess${{ matrix.platform }}/test
89+
run: sbt ++${{ matrix.scala }} 'zioProcess${{ matrix.platform }}/test'
90+
91+
test_jvms:
92+
runs-on: ubuntu-latest
93+
timeout-minutes: 30
94+
strategy:
95+
fail-fast: false
96+
matrix:
97+
java: [ '11', '21' ]
98+
scala: [ '2.13.x' ]
99+
steps:
100+
- name: Checkout current branch
101+
uses: actions/checkout@v6
102+
with:
103+
fetch-depth: 0
104+
- name: Setup Java
105+
uses: actions/setup-java@v5
106+
with:
107+
distribution: corretto
108+
java-version: ${{ matrix.java }}
109+
check-latest: true
110+
- name: Setup sbt
111+
uses: sbt/setup-sbt@v1
112+
- name: Cache scala dependencies
113+
uses: coursier/cache-action@v7
114+
- name: Install libuv
115+
run: sudo apt-get update && sudo apt-get install -y libuv1-dev
116+
- name: Run tests
117+
run: sbt ++${{ matrix.scala }} 'zioProcessJVM/test'
118+
81119

82120
ci:
83121
runs-on: ubuntu-latest
84-
needs: [lint, website, test]
122+
needs: [lint, website, test_scala, test_jvms]
85123
steps:
86124
- name: Aggregate job outcomes
87125
run: echo "build succeeded"
@@ -93,16 +131,19 @@ jobs:
93131
if: github.event_name != 'pull_request'
94132
steps:
95133
- name: Checkout current branch
96-
uses: actions/checkout@v4.1.1
134+
uses: actions/checkout@v6
97135
with:
98136
fetch-depth: 0
99-
- name: Cache scala dependencies
100-
uses: coursier/cache-action@v6
101-
- name: Setup Action
102-
uses: coursier/setup-action@v1
137+
- name: Setup Java
138+
uses: actions/setup-java@v5
103139
with:
104-
jvm: temurin:21
105-
apps: sbt
140+
distribution: corretto
141+
java-version: 17
142+
check-latest: true
143+
- name: Setup sbt
144+
uses: sbt/setup-sbt@v1
145+
- name: Cache scala dependencies
146+
uses: coursier/cache-action@v7
106147
- name: Release artifacts
107148
run: sbt ci-release
108149
env:

0 commit comments

Comments
 (0)