Skip to content

Commit 39eb689

Browse files
committed
Add pnpm installation test
1 parent 437ed3a commit 39eb689

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

.github/workflows/ci.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,9 +584,76 @@ jobs:
584584
run: ./rewatch/tests/suite-ci.sh node_modules/.bin/rescript
585585
shell: bash
586586

587+
test-integration-pnpm:
588+
needs:
589+
- pkg-pr-new
590+
strategy:
591+
fail-fast: false
592+
matrix:
593+
include:
594+
- os: macos-13
595+
- os: macos-14
596+
- os: ubuntu-24.04
597+
- os: ubuntu-24.04-arm
598+
- os: windows-latest
599+
runs-on: ${{ matrix.os }}
600+
env:
601+
RUST_BACKTRACE: "1"
602+
steps:
603+
- name: Install pnpm
604+
uses: pnpm/action-setup@v4
605+
with:
606+
version: 10
607+
608+
- name: Use Node.js
609+
uses: actions/setup-node@v4
610+
with:
611+
# Run integration tests with the oldest supported node version.
612+
node-version: 20
613+
614+
- name: Checkout
615+
uses: actions/checkout@v4
616+
617+
- name: Make test directory
618+
id: tmp-dir
619+
shell: bash
620+
run: |
621+
if [[ "$RUNNER_OS" == "Windows" ]]; then
622+
dir=$(powershell -Command "[System.IO.Path]::GetTempPath() + [System.Guid]::NewGuid().ToString()" | tr -d '\r')
623+
mkdir -p "$dir"
624+
else
625+
dir=$(mktemp -d)
626+
fi
627+
echo "path=$dir" >> "$GITHUB_OUTPUT"
628+
cp -r tests/package_tests/installation_test/* "$dir"
629+
630+
- name: Install ReScript package
631+
run: |
632+
COMMIT_SHA="${{ github.event.pull_request.head.sha || github.sha }}"
633+
pnpm i "https://pkg.pr.new/rescript-lang/rescript@${COMMIT_SHA::7}"
634+
shell: bash
635+
working-directory: ${{ steps.tmp-dir.outputs.path }}
636+
637+
- name: Test installation
638+
run: pnpm rescript -h && pnpm rescript legacy build && cat src/Test.res.js
639+
shell: bash
640+
working-directory: ${{ steps.tmp-dir.outputs.path }}
641+
642+
- name: Install ReScript package in rewatch/testrepo
643+
run: |
644+
COMMIT_SHA="${{ github.event.pull_request.head.sha || github.sha }}"
645+
yarn add "rescript@https://pkg.pr.new/rescript-lang/rescript@${COMMIT_SHA::7}"
646+
shell: bash
647+
working-directory: rewatch/testrepo
648+
649+
- name: Run rewatch integration tests
650+
run: ./rewatch/tests/suite-ci.sh node_modules/.bin/rescript
651+
shell: bash
652+
587653
publish:
588654
needs:
589655
- test-integration
656+
- test-integration-pnpm
590657
if: startsWith(github.ref, 'refs/tags/v')
591658
runs-on: ubuntu-24.04-arm
592659
steps:

0 commit comments

Comments
 (0)