Skip to content

Commit c1fbfa3

Browse files
Merge pull request #136 from alexarchambault/add-bloop-cli
Add bloop-cli modules
2 parents 5c95689 + 0e70050 commit c1fbfa3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+3833
-104
lines changed

.github/fmt.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
scalafmt "$@"
5+
6+
for dir in *; do
7+
if [ -f "$dir/.scalafmt.conf" ]; then
8+
( cd "$dir" && scalafmt "$@" )
9+
fi
10+
done
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
if [[ "$OSTYPE" != "msys" ]]; then
5+
echo "Warning: this script is intended to be run on Windows" 1>&2
6+
fi
7+
8+
./mill.bat -i ci.copyJvm --dest jvm
9+
export JAVA_HOME="$(pwd -W | sed 's,/,\\,g')\\jvm"
10+
export GRAALVM_HOME="$JAVA_HOME"
11+
export PATH="$(pwd)/bin:$PATH"
12+
echo "PATH=$PATH"
13+
./mill.bat -i "cli.writeNativeImageScript" generate-native-image.bat ""
14+
./generate-native-image.bat
15+
./mill.bat -i "cli.copyToArtifacts" artifacts/

.github/scripts/gpg-setup.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env sh
2+
3+
# from https://github.com/coursier/apps/blob/f1d2bf568bf466a98569a85c3f23c5f3a8eb5360/.github/scripts/gpg-setup.sh
4+
5+
echo "$PGP_SECRET" | base64 --decode | gpg --import --no-tty --batch --yes
6+
7+
echo "allow-loopback-pinentry" >>~/.gnupg/gpg-agent.conf
8+
echo "pinentry-mode loopback" >>~/.gnupg/gpg.conf
9+
10+
gpg-connect-agent reloadagent /bye

.github/workflows/ci.yml

Lines changed: 89 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
apps: scalafmt
2222
jvm: "temurin:17"
2323
- name: Check formatting
24-
run: scalafmt --test
24+
run: .github/fmt.sh --test
2525

2626
bridges:
27-
name: Test platform bridges
27+
name: Server bridges tests
2828
runs-on: ${{ matrix.os }}
2929
strategy:
3030
fail-fast: false
@@ -51,7 +51,7 @@ jobs:
5151
fail-fast: false
5252
matrix:
5353
os: [ubuntu-latest, windows-latest, macOS-latest]
54-
name: Test
54+
name: Server tests
5555
steps:
5656
- uses: actions/checkout@v3
5757
with:
@@ -71,15 +71,92 @@ jobs:
7171
./mill -i 'frontend[2.12.17].test'
7272
shell: bash
7373

74+
jvm-tests:
75+
name: Client JVM tests
76+
runs-on: ubuntu-latest
77+
steps:
78+
- uses: actions/checkout@v3
79+
with:
80+
fetch-depth: 0
81+
submodules: true
82+
- uses: coursier/[email protected]
83+
- uses: coursier/[email protected]
84+
with:
85+
jvm: "zulu:17"
86+
- run: |
87+
./mill -i __.publishLocal &&\
88+
./mill -i integration.test.jvm
89+
if: runner.os != 'Windows'
90+
- run: |
91+
@call ./mill.bat -i __.publishLocal
92+
@call ./mill.bat -i integration.test.jvm
93+
shell: cmd
94+
if: runner.os == 'Windows'
95+
96+
native-tests:
97+
name: Client native tests
98+
runs-on: ${{ matrix.os }}
99+
strategy:
100+
fail-fast: false
101+
matrix:
102+
os: [ubuntu-latest, windows-latest, macos-latest]
103+
steps:
104+
- uses: actions/checkout@v3
105+
with:
106+
fetch-depth: 0
107+
submodules: true
108+
- uses: coursier/[email protected]
109+
- uses: coursier/[email protected]
110+
with:
111+
jvm: "zulu:17"
112+
- run: |
113+
./mill -i "cli.writeNativeImageScript" generate.sh "" && \
114+
export USE_NATIVE_IMAGE_JAVA_PLATFORM_MODULE_SYSTEM=false &&
115+
./generate.sh && \
116+
./mill -i "cli.copyToArtifacts" artifacts/
117+
if: runner.os != 'Windows'
118+
- run: |
119+
export USE_NATIVE_IMAGE_JAVA_PLATFORM_MODULE_SYSTEM=false
120+
.github/scripts/generate-native-image-windows.sh
121+
shell: bash
122+
if: runner.os == 'Windows'
123+
- uses: actions/upload-artifact@v3
124+
with:
125+
name: launchers
126+
path: artifacts/
127+
if-no-files-found: error
128+
retention-days: 1
129+
- run: |
130+
./mill -i __.publishLocal &&\
131+
./mill -i "integration.test.native"
132+
if: github.event_name == 'push'
133+
134+
upload-launchers:
135+
name: Upload CLI
136+
needs: [scalafmt, jvm-tests, native-tests]
137+
runs-on: ubuntu-latest
138+
if: github.event_name == 'push'
139+
steps:
140+
- uses: actions/checkout@v3
141+
with:
142+
fetch-depth: 0
143+
submodules: true
144+
- uses: coursier/[email protected]
145+
- uses: coursier/[email protected]
146+
with:
147+
jvm: "zulu:17"
148+
- uses: actions/download-artifact@v3
149+
with:
150+
name: launchers
151+
path: artifacts/
152+
- run: ./mill -i ci.upload artifacts/
153+
env:
154+
UPLOAD_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
155+
74156
release:
75157
name: Release
76158
runs-on: ubuntu-latest
77159
if: github.event_name == 'push'
78-
env:
79-
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
80-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
81-
PGP_PASSWORD: ${{ secrets.PGP_PASSWORD }}
82-
PGP_PASSPHRASE: ${{ secrets.PGP_PASSWORD }}
83160
steps:
84161
- uses: actions/checkout@v3
85162
with:
@@ -88,6 +165,10 @@ jobs:
88165
- uses: coursier/[email protected]
89166
with:
90167
jvm: "temurin:17"
168+
- name: GPG setup
169+
run: .github/scripts/gpg-setup.sh
170+
env:
171+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
91172
- name: Release
92173
run: ./mill -i io.kipp.mill.ci.release.ReleaseModule/publishAll
93174
env:

.scalafmt.conf

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,50 @@
11
version = "3.7.2"
2-
runner.dialect = scala213
2+
3+
align.preset = more
34
maxColumn = 100
4-
docstrings.style = Asterisk
5-
docstrings.wrap = no
65
assumeStandardLibraryStripMargin = true
7-
newlines.beforeCurlyLambdaParams = multilineWithCaseOnly
8-
align.tokens=[]
6+
indent.defnSite = 2
7+
indentOperator.topLevelOnly = false
8+
align.preset = more
99
align.openParenCallSite = false
10-
align.openParenDefnSite = false
11-
binPack.literalArgumentLists = true
12-
project.git = true
10+
newlines.source = keep
11+
newlines.beforeMultiline = keep
12+
newlines.afterCurlyLambdaParams = keep
13+
newlines.alwaysBeforeElseAfterCurlyIf = true
14+
15+
runner.dialect = scala3
16+
17+
rewrite.rules = [
18+
RedundantBraces
19+
RedundantParens
20+
SortModifiers
21+
]
22+
23+
rewrite.redundantBraces {
24+
ifElseExpressions = true
25+
includeUnitMethods = false
26+
stringInterpolation = true
27+
}
28+
29+
rewrite.sortModifiers.order = [
30+
"private", "final", "override", "protected",
31+
"implicit", "sealed", "abstract", "lazy"
32+
]
1333

14-
# exclude submodules
1534
project.excludeFilters = [
35+
# ".bloop" # makes scalafmt 3.5.9 complain with 'Error$NoMatchingFiles$: No files formatted/tested.'
36+
".metals"
37+
"out"
38+
1639
"zinc/"
1740
"bsp/"
1841
"benchmark-bridge/"
42+
43+
# these have their own .scalafmt.conf
44+
"backend/"
45+
"benchmarks/"
46+
"bridges/"
47+
"buildpress-config/"
48+
"frontend/"
49+
"shared/"
1950
]

backend/.scalafmt.conf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version = "3.7.2"
2+
runner.dialect = scala213
3+
maxColumn = 100
4+
docstrings.style = Asterisk
5+
docstrings.wrap = no
6+
assumeStandardLibraryStripMargin = true
7+
newlines.beforeCurlyLambdaParams = multilineWithCaseOnly
8+
align.tokens=[]
9+
align.openParenCallSite = false
10+
align.openParenDefnSite = false
11+
binPack.literalArgumentLists = true
12+
project.git = true
13+
14+
# exclude submodules
15+
project.excludeFilters = [
16+
"zinc/"
17+
"bsp/"
18+
"benchmark-bridge/"
19+
]

benchmarks/.scalafmt.conf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version = "3.7.2"
2+
runner.dialect = scala213
3+
maxColumn = 100
4+
docstrings.style = Asterisk
5+
docstrings.wrap = no
6+
assumeStandardLibraryStripMargin = true
7+
newlines.beforeCurlyLambdaParams = multilineWithCaseOnly
8+
align.tokens=[]
9+
align.openParenCallSite = false
10+
align.openParenDefnSite = false
11+
binPack.literalArgumentLists = true
12+
project.git = true
13+
14+
# exclude submodules
15+
project.excludeFilters = [
16+
"zinc/"
17+
"bsp/"
18+
"benchmark-bridge/"
19+
]

0 commit comments

Comments
 (0)