Repository navigation
refactor(root): relocate the contributing guide into .github/ #17
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-License-Identifier: MPL-2.0 | |
| name: ReScript Tests | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| workflow_dispatch: | |
| permissions: read-all | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup Deno | |
| uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2.0.0 | |
| with: | |
| deno-version: v2.x | |
| - name: Cache ReScript build | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v4.2.0 | |
| with: | |
| path: | | |
| prototype/rescript/lib | |
| prototype/rescript/.bsb.lock | |
| key: rescript-${{ runner.os }}-${{ hashFiles('prototype/rescript/rescript.json') }} | |
| - name: Install ReScript | |
| working-directory: prototype/rescript | |
| run: | | |
| deno install | |
| - name: Build ReScript parser | |
| working-directory: prototype/rescript | |
| run: | | |
| deno run -A npm:rescript build | |
| - name: Run test vectors | |
| working-directory: prototype/rescript | |
| run: | | |
| # Run all 8 test vectors | |
| for vector in ../../tests/vectors/*.a2ml; do | |
| echo "Testing: $(basename $vector)" | |
| deno run -A src/Cli.res.js "$vector" || exit 1 | |
| done | |
| echo "✓ All test vectors passed" | |
| - name: Verify compiled output | |
| working-directory: prototype/rescript | |
| run: | | |
| # Check all .res files compiled successfully | |
| for res in src/*.res src/**/*.res; do | |
| if [ -f "$res" ]; then | |
| js_file="${res%.res}.res.js" | |
| if [ ! -f "$js_file" ]; then | |
| echo "Missing compiled file: $js_file" | |
| exit 1 | |
| fi | |
| fi | |
| done | |
| echo "✓ All ReScript files compiled" | |
| - name: Type check JavaScript output | |
| working-directory: prototype/rescript | |
| run: | | |
| # Verify generated JS is valid | |
| for js in src/*.res.js; do | |
| if [ -f "$js" ]; then | |
| deno check "$js" || node -c "$js" | |
| fi | |
| done | |
| echo "✓ Generated JavaScript is valid" | |
| - name: Run demo | |
| working-directory: prototype/rescript | |
| run: | | |
| deno run -A src/Demo.res.js | |
| echo "✓ Demo executed successfully" |