Skip to content

Commit 6e573b4

Browse files
authored
Merge pull request #621 from armanbilge/topic/sbt-typelevel
Migrate to sbt-typelevel-ci-release
2 parents 9d3ae9b + e747b28 commit 6e573b4

File tree

7 files changed

+395
-74
lines changed

7 files changed

+395
-74
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 261 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,261 @@
1+
# This file was automatically generated by sbt-github-actions using the
2+
# githubWorkflowGenerate task. You should add and commit this file to
3+
# your git repository. It goes without saying that you shouldn't edit
4+
# this file by hand! Instead, if you wish to make changes, you should
5+
# change your sbt build configuration to revise the workflow description
6+
# to meet your needs, then regenerate this file.
7+
8+
name: Continuous Integration
9+
10+
on:
11+
pull_request:
12+
branches: ['**']
13+
push:
14+
branches: ['**']
15+
tags: [v*]
16+
17+
env:
18+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
19+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
20+
SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
21+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
22+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
25+
jobs:
26+
build:
27+
name: Build and Test
28+
strategy:
29+
matrix:
30+
os: [ubuntu-latest]
31+
scala: [2.12.13, 2.13.8, 3.1.1]
32+
java: [temurin@8]
33+
project: [rootJS, rootJVM]
34+
runs-on: ${{ matrix.os }}
35+
steps:
36+
- name: Checkout current branch (full)
37+
uses: actions/checkout@v2
38+
with:
39+
fetch-depth: 0
40+
41+
- name: Setup Java (temurin@8)
42+
if: matrix.java == 'temurin@8'
43+
uses: actions/setup-java@v2
44+
with:
45+
distribution: temurin
46+
java-version: 8
47+
48+
- name: Cache sbt
49+
uses: actions/cache@v2
50+
with:
51+
path: |
52+
~/.sbt
53+
~/.ivy2/cache
54+
~/.coursier/cache/v1
55+
~/.cache/coursier/v1
56+
~/AppData/Local/Coursier/Cache/v1
57+
~/Library/Caches/Coursier/v1
58+
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
59+
60+
- name: Set up cert permissions
61+
run: |
62+
chmod 600 world/server.key
63+
sudo chown 999 world/server.key
64+
65+
- name: Start up Postgres
66+
run: docker-compose up -d
67+
68+
- name: Check that workflows are up to date
69+
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' 'project /' githubWorkflowCheck
70+
71+
- name: Check Headers
72+
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' headerCheckAll
73+
74+
- name: scalaJSLink
75+
if: matrix.project == 'rootJS'
76+
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' Test/scalaJSLinkerResult
77+
78+
- name: Test
79+
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' test
80+
81+
- name: Check binary compatibility
82+
if: matrix.java == 'temurin@8'
83+
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' mimaReportBinaryIssues
84+
85+
- name: Generate API documentation
86+
if: matrix.java == 'temurin@8'
87+
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' doc
88+
89+
- name: Check Doc Site (2.13.8 JVM only)
90+
if: matrix.scala == '2.13.8' && matrix.project == 'rootJVM'
91+
run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' docs/makeSite
92+
93+
- name: Make target directories
94+
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
95+
run: mkdir -p modules/circe/.jvm/target target .js/target modules/docs/target modules/core/js/target modules/circe/.js/target modules/core/jvm/target modules/tests/js/target .jvm/target .native/target modules/refined/.js/target modules/refined/.jvm/target modules/tests/jvm/target modules/example/target project/target
96+
97+
- name: Compress target directories
98+
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
99+
run: tar cf targets.tar modules/circe/.jvm/target target .js/target modules/docs/target modules/core/js/target modules/circe/.js/target modules/core/jvm/target modules/tests/js/target .jvm/target .native/target modules/refined/.js/target modules/refined/.jvm/target modules/tests/jvm/target modules/example/target project/target
100+
101+
- name: Upload target directories
102+
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
103+
uses: actions/upload-artifact@v2
104+
with:
105+
name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}-${{ matrix.project }}
106+
path: targets.tar
107+
108+
publish:
109+
name: Publish Artifacts
110+
needs: [build]
111+
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
112+
strategy:
113+
matrix:
114+
os: [ubuntu-latest]
115+
scala: [2.13.8]
116+
java: [temurin@8]
117+
runs-on: ${{ matrix.os }}
118+
steps:
119+
- name: Checkout current branch (full)
120+
uses: actions/checkout@v2
121+
with:
122+
fetch-depth: 0
123+
124+
- name: Setup Java (temurin@8)
125+
if: matrix.java == 'temurin@8'
126+
uses: actions/setup-java@v2
127+
with:
128+
distribution: temurin
129+
java-version: 8
130+
131+
- name: Cache sbt
132+
uses: actions/cache@v2
133+
with:
134+
path: |
135+
~/.sbt
136+
~/.ivy2/cache
137+
~/.coursier/cache/v1
138+
~/.cache/coursier/v1
139+
~/AppData/Local/Coursier/Cache/v1
140+
~/Library/Caches/Coursier/v1
141+
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
142+
143+
- name: Download target directories (2.12.13, rootJS)
144+
uses: actions/download-artifact@v2
145+
with:
146+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.13-rootJS
147+
148+
- name: Inflate target directories (2.12.13, rootJS)
149+
run: |
150+
tar xf targets.tar
151+
rm targets.tar
152+
153+
- name: Download target directories (2.12.13, rootJVM)
154+
uses: actions/download-artifact@v2
155+
with:
156+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.13-rootJVM
157+
158+
- name: Inflate target directories (2.12.13, rootJVM)
159+
run: |
160+
tar xf targets.tar
161+
rm targets.tar
162+
163+
- name: Download target directories (2.13.8, rootJS)
164+
uses: actions/download-artifact@v2
165+
with:
166+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-rootJS
167+
168+
- name: Inflate target directories (2.13.8, rootJS)
169+
run: |
170+
tar xf targets.tar
171+
rm targets.tar
172+
173+
- name: Download target directories (2.13.8, rootJVM)
174+
uses: actions/download-artifact@v2
175+
with:
176+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-rootJVM
177+
178+
- name: Inflate target directories (2.13.8, rootJVM)
179+
run: |
180+
tar xf targets.tar
181+
rm targets.tar
182+
183+
- name: Download target directories (3.1.1, rootJS)
184+
uses: actions/download-artifact@v2
185+
with:
186+
name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.1-rootJS
187+
188+
- name: Inflate target directories (3.1.1, rootJS)
189+
run: |
190+
tar xf targets.tar
191+
rm targets.tar
192+
193+
- name: Download target directories (3.1.1, rootJVM)
194+
uses: actions/download-artifact@v2
195+
with:
196+
name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.1-rootJVM
197+
198+
- name: Inflate target directories (3.1.1, rootJVM)
199+
run: |
200+
tar xf targets.tar
201+
rm targets.tar
202+
203+
- name: Import signing key
204+
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
205+
run: echo $PGP_SECRET | base64 -di | gpg --import
206+
207+
- name: Import signing key and strip passphrase
208+
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
209+
run: |
210+
echo "$PGP_SECRET" | base64 -di > /tmp/signing-key.gpg
211+
echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
212+
(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)
213+
214+
- name: Publish
215+
run: sbt '++${{ matrix.scala }}' tlRelease
216+
217+
coverage:
218+
name: Generate coverage report (2.13.8 JVM only)
219+
strategy:
220+
matrix:
221+
os: [ubuntu-latest]
222+
scala: [2.13.8]
223+
java: [temurin@11]
224+
runs-on: ${{ matrix.os }}
225+
steps:
226+
- name: Checkout current branch (full)
227+
uses: actions/checkout@v2
228+
with:
229+
fetch-depth: 0
230+
231+
- name: Setup Java (temurin@8)
232+
if: matrix.java == 'temurin@8'
233+
uses: actions/setup-java@v2
234+
with:
235+
distribution: temurin
236+
java-version: 8
237+
238+
- name: Cache sbt
239+
uses: actions/cache@v2
240+
with:
241+
path: |
242+
~/.sbt
243+
~/.ivy2/cache
244+
~/.coursier/cache/v1
245+
~/.cache/coursier/v1
246+
~/AppData/Local/Coursier/Cache/v1
247+
~/Library/Caches/Coursier/v1
248+
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
249+
250+
- name: Set up cert permissions
251+
run: |
252+
chmod 600 world/server.key
253+
sudo chown 999 world/server.key
254+
255+
- name: Start up Postgres
256+
run: docker-compose up -d
257+
258+
- run: sbt '++${{ matrix.scala }}' coverage rootJVM/test coverageReport
259+
260+
- name: Upload code coverage data
261+
run: 'bash <(curl -s https://codecov.io/bash)'

.github/workflows/clean.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# This file was automatically generated by sbt-github-actions using the
2+
# githubWorkflowGenerate task. You should add and commit this file to
3+
# your git repository. It goes without saying that you shouldn't edit
4+
# this file by hand! Instead, if you wish to make changes, you should
5+
# change your sbt build configuration to revise the workflow description
6+
# to meet your needs, then regenerate this file.
7+
8+
name: Clean
9+
10+
on: push
11+
12+
jobs:
13+
delete-artifacts:
14+
name: Delete Artifacts
15+
runs-on: ubuntu-latest
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
steps:
19+
- name: Delete artifacts
20+
run: |
21+
# Customize those three lines with your repository and credentials:
22+
REPO=${GITHUB_API_URL}/repos/${{ github.repository }}
23+
24+
# A shortcut to call GitHub API.
25+
ghapi() { curl --silent --location --user _:$GITHUB_TOKEN "$@"; }
26+
27+
# A temporary file which receives HTTP response headers.
28+
TMPFILE=/tmp/tmp.$$
29+
30+
# An associative array, key: artifact name, value: number of artifacts of that name.
31+
declare -A ARTCOUNT
32+
33+
# Process all artifacts on this repository, loop on returned "pages".
34+
URL=$REPO/actions/artifacts
35+
while [[ -n "$URL" ]]; do
36+
37+
# Get current page, get response headers in a temporary file.
38+
JSON=$(ghapi --dump-header $TMPFILE "$URL")
39+
40+
# Get URL of next page. Will be empty if we are at the last page.
41+
URL=$(grep '^Link:' "$TMPFILE" | tr ',' '\n' | grep 'rel="next"' | head -1 | sed -e 's/.*<//' -e 's/>.*//')
42+
rm -f $TMPFILE
43+
44+
# Number of artifacts on this page:
45+
COUNT=$(( $(jq <<<$JSON -r '.artifacts | length') ))
46+
47+
# Loop on all artifacts on this page.
48+
for ((i=0; $i < $COUNT; i++)); do
49+
50+
# Get name of artifact and count instances of this name.
51+
name=$(jq <<<$JSON -r ".artifacts[$i].name?")
52+
ARTCOUNT[$name]=$(( $(( ${ARTCOUNT[$name]} )) + 1))
53+
54+
id=$(jq <<<$JSON -r ".artifacts[$i].id?")
55+
size=$(( $(jq <<<$JSON -r ".artifacts[$i].size_in_bytes?") ))
56+
printf "Deleting '%s' #%d, %'d bytes\n" $name ${ARTCOUNT[$name]} $size
57+
ghapi -X DELETE $REPO/actions/artifacts/$id
58+
done
59+
done

.github/workflows/release.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.jvmopts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-Xms1G
2+
-Xmx4G
3+
-XX:+UseG1GC
4+
-Xss10m

0 commit comments

Comments
 (0)