Skip to content

Commit 88e8b61

Browse files
committed
end to end tests
1 parent e1c36d0 commit 88e8b61

File tree

2 files changed

+18
-26
lines changed

2 files changed

+18
-26
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ env:
2020
OCAMLRUNPARAM: b
2121

2222
jobs:
23-
test-rewatch:
24-
# needs:
25-
# - publish
23+
test-rewatch-integration:
24+
needs:
25+
- pkg-pr-new
2626
runs-on: ubuntu-latest
2727
env:
2828
RUST_BACKTRACE: "1"
@@ -35,32 +35,17 @@ jobs:
3535
uses: actions/setup-node@v4
3636
with:
3737
node-version-file: .nvmrc
38-
39-
- name: Restore build cache
40-
id: build-cache
41-
uses: actions/cache@v4
42-
with:
43-
path: rewatch/target
44-
key: rewatch-build-v2-${{ runner.os }}-${{ hashFiles('rewatch/src/**', 'rewatch/Cargo.lock') }}
45-
46-
- name: Install rust toolchain
47-
if: steps.build-cache.outputs.cache-hit != 'true'
48-
uses: dtolnay/rust-toolchain@master
49-
with:
50-
toolchain: stable
51-
52-
- name: Build rewatch
53-
if: steps.build-cache.outputs.cache-hit != 'true'
54-
run: |
55-
cargo build --manifest-path rewatch/Cargo.toml --release
56-
57-
- name: Run rewatch unit tests
38+
- name: Install ReScript package
5839
run: |
59-
cargo test --manifest-path rewatch/Cargo.toml
40+
COMMIT_SHA="${{ github.event.pull_request.head.sha || github.sha }}"
41+
npm i --no-audit \
42+
"https://pkg.pr.new/rescript-lang/rescript@${COMMIT_SHA::7}"
43+
shell: bash
44+
working-directory: rewatch/testrepo
6045

6146
- name: Run rewatch integration tests
6247
run: |
63-
make test-rewatch
48+
make test-rewatch-ci
6449
6550
build-rewatch:
6651
strategy:
@@ -120,6 +105,10 @@ jobs:
120105
run: |
121106
cargo build --manifest-path rewatch/Cargo.toml --target ${{ matrix.rust-target }} --release
122107
108+
- name: Run rewatch unit tests
109+
run: |
110+
cargo test --manifest-path rewatch/Cargo.toml
111+
123112
- name: Copy rewatch binary
124113
run: |
125114
cp rewatch/target/${{ matrix.rust-target }}/release/rewatch${{ runner.os == 'Windows' && '.exe' || '' }} rewatch.exe

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ test-gentype:
4747
make -C tests/gentype_tests/typescript-react-example clean test
4848

4949
test-rewatch:
50-
bash ./rewatch/tests/suite.sh
50+
bash ./rewatch/tests/suite-ci.sh
51+
52+
test-rewatch-ci:
53+
bash ./rewatch/tests/suite-ci.sh
5154

5255
test-all: test test-gentype test-analysis test-tools test-rewatch
5356

0 commit comments

Comments
 (0)