Skip to content

Commit 8aeb129

Browse files
committed
set-swap-space
1 parent a369888 commit 8aeb129

File tree

4 files changed

+43
-168
lines changed

4 files changed

+43
-168
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 165 deletions
Original file line numberDiff line numberDiff line change
@@ -9,248 +9,112 @@ name: Continuous Integration
99

1010
on:
1111
pull_request:
12-
branches: ['**', '!update/**', '!pr/**']
12+
branches: ['**']
1313
push:
14-
branches: ['**', '!update/**', '!pr/**']
15-
tags: [v*]
14+
branches: ['**']
1615

1716
env:
1817
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1918

20-
21-
concurrency:
22-
group: ${{ github.workflow }} @ ${{ github.ref }}
23-
cancel-in-progress: true
24-
2519
jobs:
2620
build:
2721
name: Build and Test
2822
strategy:
2923
matrix:
3024
os: [ubuntu-latest]
31-
scala: [2.12, 2.13, 3]
25+
scala: [2.12.17, 2.13.14, 3.3.3]
3226
java: [corretto@11]
33-
project: [rootJS, rootJVM, rootNative]
34-
include:
35-
- scala: 3
36-
java: corretto@11
37-
project: rootNative
38-
os: macos-latest
39-
exclude:
40-
- scala: 3
41-
project: rootJVM
42-
- scala: 3
43-
project: rootNative
44-
os: ubuntu-latest
4527
runs-on: ${{ matrix.os }}
46-
timeout-minutes: 60
4728
steps:
29+
- uses: pierotofy/set-swap-space@master
30+
with:
31+
swap-size-gb: 5
32+
4833
- name: Checkout current branch (full)
4934
uses: actions/checkout@v4
5035
with:
5136
fetch-depth: 0
5237

5338
- name: Setup Java (corretto@11)
54-
id: setup-java-corretto-11
5539
if: matrix.java == 'corretto@11'
5640
uses: actions/setup-java@v4
5741
with:
5842
distribution: corretto
5943
java-version: 11
6044
cache: sbt
6145

62-
- name: sbt update
63-
if: matrix.java == 'corretto@11' && steps.setup-java-corretto-11.outputs.cache-hit == 'false'
64-
run: ./sbt +update
65-
6646
- name: Check that workflows are up to date
67-
run: ./sbt githubWorkflowCheck
68-
69-
- name: scalaJSLink
70-
if: matrix.project == 'rootJS'
71-
run: ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/scalaJSLinkerResult
72-
73-
- name: nativeLink
74-
if: matrix.project == 'rootNative'
75-
run: ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/nativeLink
76-
77-
- name: Test
78-
run: ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' test
79-
80-
- name: Check binary compatibility
81-
if: matrix.java == 'corretto@11' && matrix.os == 'ubuntu-latest'
82-
run: ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' mimaReportBinaryIssues
47+
run: ./sbt '++ ${{ matrix.scala }}' githubWorkflowCheck
8348

84-
- name: Generate API documentation
85-
if: matrix.java == 'corretto@11' && matrix.os == 'ubuntu-latest'
86-
run: ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' doc
87-
88-
- name: Make target directories
89-
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master')
90-
run: mkdir -p core/native/target tzdb/js/target core/js/target core/jvm/target tzdb/jvm/target tzdb/native/target project/target
49+
- name: Build project
50+
run: ./sbt '++ ${{ matrix.scala }}' test
9151

9252
- name: Compress target directories
93-
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master')
94-
run: tar cf targets.tar core/native/target tzdb/js/target core/js/target core/jvm/target tzdb/jvm/target tzdb/native/target project/target
53+
run: tar cf targets.tar target core/native/target tzdb/js/target core/js/target core/jvm/target tests/js/target demo/jvm/target tests/jvm/target demo/native/target tzdb/jvm/target tzdb/native/target tests/native/target demo/js/target project/target
9554

9655
- name: Upload target directories
97-
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master')
9856
uses: actions/upload-artifact@v4
9957
with:
100-
name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}-${{ matrix.project }}
58+
name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}
10159
path: targets.tar
10260

10361
publish:
10462
name: Publish Artifacts
10563
needs: [build]
106-
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master')
64+
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main')
10765
strategy:
10866
matrix:
10967
os: [ubuntu-latest]
68+
scala: [2.13.14]
11069
java: [corretto@11]
11170
runs-on: ${{ matrix.os }}
11271
steps:
72+
- uses: pierotofy/set-swap-space@master
73+
with:
74+
swap-size-gb: 5
75+
11376
- name: Checkout current branch (full)
11477
uses: actions/checkout@v4
11578
with:
11679
fetch-depth: 0
11780

11881
- name: Setup Java (corretto@11)
119-
id: setup-java-corretto-11
12082
if: matrix.java == 'corretto@11'
12183
uses: actions/setup-java@v4
12284
with:
12385
distribution: corretto
12486
java-version: 11
12587
cache: sbt
12688

127-
- name: sbt update
128-
if: matrix.java == 'corretto@11' && steps.setup-java-corretto-11.outputs.cache-hit == 'false'
129-
run: ./sbt +update
130-
131-
- name: Download target directories (2.12, rootJS)
132-
uses: actions/download-artifact@v4
133-
with:
134-
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootJS
135-
136-
- name: Inflate target directories (2.12, rootJS)
137-
run: |
138-
tar xf targets.tar
139-
rm targets.tar
140-
141-
- name: Download target directories (2.12, rootJVM)
142-
uses: actions/download-artifact@v4
143-
with:
144-
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootJVM
145-
146-
- name: Inflate target directories (2.12, rootJVM)
147-
run: |
148-
tar xf targets.tar
149-
rm targets.tar
150-
151-
- name: Download target directories (2.12, rootNative)
152-
uses: actions/download-artifact@v4
153-
with:
154-
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootNative
155-
156-
- name: Inflate target directories (2.12, rootNative)
157-
run: |
158-
tar xf targets.tar
159-
rm targets.tar
160-
161-
- name: Download target directories (2.13, rootJS)
89+
- name: Download target directories (2.12.17)
16290
uses: actions/download-artifact@v4
16391
with:
164-
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootJS
92+
name: target-${{ matrix.os }}-2.12.17-${{ matrix.java }}
16593

166-
- name: Inflate target directories (2.13, rootJS)
94+
- name: Inflate target directories (2.12.17)
16795
run: |
16896
tar xf targets.tar
16997
rm targets.tar
17098
171-
- name: Download target directories (2.13, rootJVM)
99+
- name: Download target directories (2.13.14)
172100
uses: actions/download-artifact@v4
173101
with:
174-
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootJVM
102+
name: target-${{ matrix.os }}-2.13.14-${{ matrix.java }}
175103

176-
- name: Inflate target directories (2.13, rootJVM)
104+
- name: Inflate target directories (2.13.14)
177105
run: |
178106
tar xf targets.tar
179107
rm targets.tar
180108
181-
- name: Download target directories (2.13, rootNative)
109+
- name: Download target directories (3.3.3)
182110
uses: actions/download-artifact@v4
183111
with:
184-
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootNative
112+
name: target-${{ matrix.os }}-3.3.3-${{ matrix.java }}
185113

186-
- name: Inflate target directories (2.13, rootNative)
114+
- name: Inflate target directories (3.3.3)
187115
run: |
188116
tar xf targets.tar
189117
rm targets.tar
190118
191-
- name: Download target directories (3, rootJS)
192-
uses: actions/download-artifact@v4
193-
with:
194-
name: target-${{ matrix.os }}-${{ matrix.java }}-3-rootJS
195-
196-
- name: Inflate target directories (3, rootJS)
197-
run: |
198-
tar xf targets.tar
199-
rm targets.tar
200-
201-
- name: Import signing key
202-
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
203-
env:
204-
PGP_SECRET: ${{ secrets.PGP_SECRET }}
205-
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
206-
run: echo $PGP_SECRET | base64 -d -i - | gpg --import
207-
208-
- name: Import signing key and strip passphrase
209-
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
210-
env:
211-
PGP_SECRET: ${{ secrets.PGP_SECRET }}
212-
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
213-
run: |
214-
echo "$PGP_SECRET" | base64 -d -i - > /tmp/signing-key.gpg
215-
echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
216-
(echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1)
217-
218-
- name: Publish
219-
env:
220-
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
221-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
222-
SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
223-
run: ./sbt tlCiRelease
224-
225-
dependency-submission:
226-
name: Submit Dependencies
227-
if: github.event_name != 'pull_request'
228-
strategy:
229-
matrix:
230-
os: [ubuntu-latest]
231-
java: [corretto@11]
232-
runs-on: ${{ matrix.os }}
233-
steps:
234-
- name: Checkout current branch (full)
235-
uses: actions/checkout@v4
236-
with:
237-
fetch-depth: 0
238-
239-
- name: Setup Java (corretto@11)
240-
id: setup-java-corretto-11
241-
if: matrix.java == 'corretto@11'
242-
uses: actions/setup-java@v4
243-
with:
244-
distribution: corretto
245-
java-version: 11
246-
cache: sbt
247-
248-
- name: sbt update
249-
if: matrix.java == 'corretto@11' && steps.setup-java-corretto-11.outputs.cache-hit == 'false'
250-
run: ./sbt +update
251-
252-
- name: Submit Dependencies
253-
uses: scalacenter/sbt-dependency-submission@v2
254-
with:
255-
modules-ignore: rootjs_2.12 rootjs_2.13 rootjs_3 tests_sjs1_2.12 tests_sjs1_2.13 tests_sjs1_3 rootjvm_2.12 rootjvm_2.13 rootjvm_3 rootnative_2.12 rootnative_2.13 rootnative_3 demo_2.12 demo_2.13 demo_3 tests_2.12 tests_2.13 tests_3 demo_native0.5_2.12 demo_native0.5_2.13 demo_native0.5_3 tests_native0.5_2.12 tests_native0.5_2.13 tests_native0.5_3 demo_sjs1_2.12 demo_sjs1_2.13 demo_sjs1_3
256-
configs-ignore: test scala-tool scala-doc-tool test-internal
119+
- name: Publish project
120+
run: ./sbt +publish

.github/workflows/clean.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1818
steps:
1919
- name: Delete artifacts
20+
shell: bash {0}
2021
run: |
2122
# Customize those three lines with your repository and credentials:
2223
REPO=${GITHUB_API_URL}/repos/${{ github.repository }}
@@ -25,7 +26,7 @@ jobs:
2526
ghapi() { curl --silent --location --user _:$GITHUB_TOKEN "$@"; }
2627
2728
# A temporary file which receives HTTP response headers.
28-
TMPFILE=/tmp/tmp.$$
29+
TMPFILE=$(mktemp)
2930
3031
# An associative array, key: artifact name, value: number of artifacts of that name.
3132
declare -A ARTCOUNT

build.sbt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,16 @@ val scala3 = "3.3.3"
33
ThisBuild / scalaVersion := scala213
44
ThisBuild / crossScalaVersions := Seq("2.12.17", scala213, scala3)
55

6-
ThisBuild / tlBaseVersion := "2.5"
6+
ThisBuild / githubWorkflowGeneratedCI ~= {
7+
_.map(wj =>
8+
wj.copy(
9+
steps = WorkflowStep.Use(
10+
ref = UseRef.Public("pierotofy", "set-swap-space", "master"),
11+
params = Map("swap-size-gb" -> "5")
12+
) +: wj.steps
13+
)
14+
)
15+
}
716

817
val javaDistro = JavaSpec.corretto("11")
918
ThisBuild / githubWorkflowJavaVersions := Seq(javaDistro)

project/plugins.sbt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0")
44

55
addSbtPlugin("io.github.cquiroz" % "sbt-tzdb" % "4.2.0")
66

7-
addSbtPlugin("org.typelevel" % "sbt-typelevel-ci-release" % "0.7.1")
7+
addSbtPlugin("com.github.sbt" % "sbt-github-actions" % "0.23.0")
8+
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
89

910
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2")
1011

0 commit comments

Comments
 (0)