Repository navigation
fix(vscode): allow typed source imports #96
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
| name: Check | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: check-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| repository: | |
| name: Compiler, tooling, Wasm, and runtime | |
| runs-on: windows-latest | |
| timeout-minutes: 45 | |
| steps: | |
| - name: Check out the repository | |
| uses: actions/checkout@v7 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy, rustfmt | |
| targets: wasm32-unknown-unknown | |
| - name: Install Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| cache-dependency-path: editors/vscode/package-lock.json | |
| - name: Install extension dependencies | |
| working-directory: editors/vscode | |
| run: npm ci | |
| - name: Install WebAssembly validation tools | |
| shell: pwsh | |
| env: | |
| WASM_TOOLS_VERSION: 1.201.0 | |
| WASM_TOOLS_SHA256: 9b80cf19d25603da8a8a0814c0d2bbfdc5b5fbd70d399c013237ed64661756a7 | |
| run: | | |
| $archive = Join-Path $env:RUNNER_TEMP "wasm-tools.zip" | |
| $destination = Join-Path $env:RUNNER_TEMP "wasm-tools" | |
| $url = "https://github.com/bytecodealliance/wasm-tools/releases/download/v$env:WASM_TOOLS_VERSION/wasm-tools-$env:WASM_TOOLS_VERSION-x86_64-windows.zip" | |
| Invoke-WebRequest -Uri $url -OutFile $archive | |
| $actualHash = (Get-FileHash -Algorithm SHA256 $archive).Hash.ToLowerInvariant() | |
| if ($actualHash -ne $env:WASM_TOOLS_SHA256) { | |
| throw "wasm-tools archive checksum mismatch: $actualHash" | |
| } | |
| Expand-Archive -Path $archive -DestinationPath $destination | |
| $binaryDirectory = Join-Path $destination "wasm-tools-$env:WASM_TOOLS_VERSION-x86_64-windows" | |
| $binaryDirectory | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| & (Join-Path $binaryDirectory "wasm-tools.exe") --version | |
| - name: Reject tracked compiler artifacts | |
| shell: pwsh | |
| run: | | |
| # Textual .wat files under test/fixtures are hand-written test inputs. | |
| $artifacts = git ls-files -- '*.wasm' '*.wat' ':(exclude)editors/vscode/test/fixtures/*.wat' | |
| if ($artifacts) { | |
| Write-Error "Generated WebAssembly artifacts must not be tracked:`n$artifacts" | |
| } | |
| - name: Run the repository verification matrix | |
| run: cargo xtask check | |
| vscode-native: | |
| name: VS Code native bridge (${{ matrix.platform }}) | |
| runs-on: ${{ matrix.runner }} | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: win32-x64 | |
| runner: windows-latest | |
| - platform: linux-x64 | |
| runner: ubuntu-latest | |
| - platform: linux-arm64 | |
| runner: ubuntu-24.04-arm | |
| - platform: darwin-x64 | |
| runner: macos-15-intel | |
| - platform: darwin-arm64 | |
| runner: macos-15 | |
| steps: | |
| - name: Check out the repository | |
| uses: actions/checkout@v7 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24 | |
| - name: Test the native process bridge | |
| run: cargo test --package splitscript-process-native | |
| - name: Build the native process bridge | |
| run: node editors/vscode/scripts/build-native.mjs | |
| - name: Probe process discovery and memory access | |
| run: node editors/vscode/scripts/probe-native.mjs | |
| - name: Upload the native process bridge | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: vscode-native-${{ matrix.platform }} | |
| path: editors/vscode/dist/native | |
| if-no-files-found: error | |
| vscode-package: | |
| name: Assemble VS Code extension | |
| needs: | |
| - repository | |
| - vscode-native | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out the repository | |
| uses: actions/checkout@v7 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Install Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| cache-dependency-path: editors/vscode/package-lock.json | |
| - name: Install extension dependencies | |
| working-directory: editors/vscode | |
| run: npm ci | |
| - name: Download native process bridges | |
| uses: actions/download-artifact@v7 | |
| with: | |
| pattern: vscode-native-* | |
| path: ${{ runner.temp }}/splitscript-native | |
| merge-multiple: true | |
| - name: Package the extension | |
| working-directory: editors/vscode | |
| env: | |
| SPLITSCRIPT_NATIVE_ARTIFACTS: ${{ runner.temp }}/splitscript-native | |
| SPLITSCRIPT_REQUIRED_NATIVE_PLATFORMS: win32-x64,linux-x64,linux-arm64,darwin-x64,darwin-arm64 | |
| run: npm run package:vsix -- --out splitscript-latest.vsix | |
| - name: Verify native bridges in the VSIX | |
| shell: bash | |
| run: | | |
| archive="editors/vscode/splitscript-latest.vsix" | |
| for platform in win32-x64 linux-x64 linux-arm64 darwin-x64 darwin-arm64; do | |
| if ! unzip -Z1 "$archive" | grep -Fxq "extension/dist/native/$platform/splitscript_process_native.node"; then | |
| echo "Missing native bridge for $platform" >&2 | |
| exit 1 | |
| fi | |
| done | |
| - name: Upload the assembled VSIX | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: splitscript-vscode-extension | |
| path: editors/vscode/splitscript-latest.vsix | |
| if-no-files-found: error | |
| vscode-release: | |
| name: Publish latest VS Code extension | |
| needs: vscode-package | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Check out the repository | |
| uses: actions/checkout@v7 | |
| - name: Download the assembled VSIX | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: splitscript-vscode-extension | |
| path: editors/vscode | |
| - name: Publish the latest release | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| asset="editors/vscode/splitscript-latest.vsix" | |
| title="Latest SplitScript VS Code Extension" | |
| notes="Continuously updated from the latest verified commit on master. This early build may introduce breaking language changes." | |
| git tag --force latest "$GITHUB_SHA" | |
| git push --force origin refs/tags/latest | |
| if gh release view latest >/dev/null 2>&1; then | |
| gh release edit latest --title "$title" --notes "$notes" --latest | |
| gh release upload latest "$asset" --clobber | |
| else | |
| gh release create latest "$asset" --verify-tag --title "$title" --notes "$notes" --latest | |
| fi |