Skip to content

Commit 9f4ba4c

Browse files
authored
Merge pull request #6 from danieletorelli/initial-tests
Add initial tests
2 parents 446c1c1 + 0a68574 commit 9f4ba4c

35 files changed

+1867
-184
lines changed

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
3+
updates:
4+
5+
# Maintain dependencies for GitHub Actions
6+
- package-ecosystem: "github-actions"
7+
directory: "/"
8+
schedule:
9+
interval: "monthly"

.github/workflows/ci.yaml

Lines changed: 53 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,75 @@ name: CI
22

33
on:
44
push:
5-
tags:
6-
- 'v*.*.*'
7-
branches:
8-
- main
5+
tags: [ 'v*.*.*' ]
6+
branches: [ '**' ]
97
pull_request:
108

119
env:
1210
CARGO_TERM_COLOR: always
1311

1412
jobs:
1513
build:
16-
1714
runs-on: ubuntu-latest
1815
steps:
19-
- uses: actions/checkout@v3
20-
- uses: actions/cache@v3
21-
with:
22-
path: |
23-
~/.cargo/bin/
24-
~/.cargo/registry/index/
25-
~/.cargo/registry/cache/
26-
~/.cargo/git/db/
27-
target/
28-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-is
29-
- name: Setup Rust
30-
uses: actions-rs/toolchain@v1
31-
with:
32-
toolchain: stable
33-
override: true
34-
- name: Check formatting
35-
run: cargo fmt -- --check
36-
- name: Clippy
37-
run: cargo clippy -- -Dwarnings
38-
- name: Tests
39-
run: cargo test --all-features
16+
- uses: actions/checkout@v4
17+
- uses: actions/cache@v4
18+
with:
19+
path: |
20+
~/.cargo/bin/
21+
~/.cargo/registry/index/
22+
~/.cargo/registry/cache/
23+
~/.cargo/git/db/
24+
target/
25+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-is
26+
- name: Setup Rust
27+
uses: dtolnay/rust-toolchain@stable
28+
with:
29+
toolchain: stable
30+
- name: Check formatting
31+
run: cargo fmt -- --check
32+
- name: Clippy
33+
run: cargo clippy -- -Dwarnings
34+
- name: Tests
35+
run: cargo test --all-features --test all
4036

41-
publish:
37+
build-scala:
4238
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 ]
4366
if: "startsWith(github.ref, 'refs/tags/v')"
4467
runs-on: ubuntu-latest
4568
steps:
4669
- name: Checkout
47-
uses: actions/checkout@v3
70+
uses: actions/checkout@v4
4871
with:
4972
submodules: true
50-
- uses: actions/cache@v3
73+
- uses: actions/cache@v4
5174
with:
5275
path: |
5376
~/.cargo/bin/
@@ -56,12 +79,10 @@ jobs:
5679
~/.cargo/git/db/
5780
target/
5881
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-is
59-
6082
- name: Setup Rust
61-
uses: actions-rs/toolchain@v1
83+
uses: dtolnay/rust-toolchain@stable
6284
with:
6385
toolchain: stable
64-
override: true
6586
- id: get_version
6687
uses: battila7/get-version-action@v2
6788
- name: Publish crate

0 commit comments

Comments
 (0)