Skip to content

Commit 9fb3aed

Browse files
Add Scala compilation job
1 parent 7bc9280 commit 9fb3aed

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

.github/workflows/ci.yaml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,35 @@ jobs:
3434
- name: Tests
3535
run: cargo test --all-features --test all
3636

37-
publish:
37+
build-scala:
3838
needs: [ build ]
39+
strategy:
40+
matrix:
41+
scala-version: [ 2.12.19, 2.13.14 ]
42+
scalajs-version: [ 1.16.0 ]
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v4
46+
- name: Setup Scala
47+
run: |
48+
curl -O https://downloads.lightbend.com/scala/${{ matrix.scala-version }}/scala-${{ matrix.scala-version }}.deb
49+
sudo dpkg -i scala-${{ matrix.scala-version }}.deb
50+
rm scala-${{ matrix.scala-version }}.deb
51+
- name: Setup Scalajs
52+
run: |
53+
cd tests/wit
54+
SCALA_VERSION_SHORT="$(echo ${{ matrix.scala-version }} | cut -d. -f1,2)"
55+
SCALAJS_LIBRARY="scalajs-library_${SCALA_VERSION_SHORT}-${{ matrix.scalajs-version }}.jar"
56+
curl -O "https://repo1.maven.org/maven2/org/scala-js/scalajs-library_${SCALA_VERSION_SHORT}/${{ matrix.scalajs-version }}/${SCALAJS_LIBRARY}"
57+
- name: Compile
58+
run: |
59+
cd tests/wit
60+
SCALA_VERSION_SHORT="$(echo ${{ matrix.scala-version }} | cut -d. -f1,2)"
61+
SCALAJS_LIBRARY="scalajs-library_${SCALA_VERSION_SHORT}-${{ matrix.scalajs-version }}.jar"
62+
find . -name "*.scala" | grep -vFf <(grep -v '^#' scalac-excluded.txt) | xargs -I {} scalac -classpath "${SCALAJS_LIBRARY}" {}
63+
64+
publish:
65+
needs: [ build, build-scala ]
3966
if: "startsWith(github.ref, 'refs/tags/v')"
4067
runs-on: ubuntu-latest
4168
steps:
@@ -53,10 +80,9 @@ jobs:
5380
target/
5481
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-is
5582
- name: Setup Rust
56-
uses: actions-rs/toolchain@v1
83+
uses: dtolnay/rust-toolchain@stable
5784
with:
5885
toolchain: stable
59-
override: true
6086
- id: get_version
6187
uses: battila7/get-version-action@v2
6288
- name: Publish crate

0 commit comments

Comments
 (0)