Skip to content

Commit c9b18e1

Browse files
committed
use an isolated directory for installation test
1 parent bc5ba8c commit c9b18e1

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,23 +513,36 @@ jobs:
513513
with:
514514
node-version-file: .nvmrc
515515

516+
- name: Make test directory
517+
id: tmp-dir
518+
shell: bash
519+
run: |
520+
if [[ "$RUNNER_OS" == "Windows" ]]; then
521+
dir=$(powershell -Command "[System.IO.Path]::GetTempPath() + [System.Guid]::NewGuid().ToString()" | tr -d '\r')
522+
mkdir -p "$dir"
523+
else
524+
dir=$(mktemp -d)
525+
fi
526+
echo "path=$dir" >> "$GITHUB_OUTPUT"
527+
cp -r packages/test/* "$dir"
528+
516529
- name: Download artifacts
517530
uses: actions/download-artifact@v4
518531
with:
519532
name: npm-packages
520-
path: packages/test
533+
path: ${{ steps.tmp-dir.outputs.path }}
521534

522535
- name: Install ReScript package
523536
run: |
524537
npm i --ignore-scripts --no-audit \
525538
rescript-${{ needs.package.outputs.rescript_version }}.tgz
526539
shell: bash
527-
working-directory: packages/test
540+
working-directory: ${{ steps.tmp-dir.outputs.path }}
528541

529542
- name: Test installation
530543
run: npx rescript -h && npx rescript build && cat src/Test.bs.js
531544
shell: bash
532-
working-directory: packages/test
545+
working-directory: ${{ steps.tmp-dir.outputs.path }}
533546

534547
publish:
535548
needs: [package, installationTest]

0 commit comments

Comments
 (0)