Skip to content

hardcode js safe range #199

hardcode js safe range

hardcode js safe range #199

Workflow file for this run

name: "Run Tests"
on:
workflow_dispatch:
push:
branches:
- "**"
paths:
[
"**Package.resolved",
"**.swift",
"**.js",
"Tests/package.json",
"Tests/package-lock.json",
".github/workflows/run_tests.yml",
]
jobs:
swift-format:
name: Format Swift
runs-on: ubuntu-latest
outputs:
commitSHA: ${{ steps.output-commit.outputs.commitSHA }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install SwiftFormat
uses: Cyberbeni/install-swift-tool@v2
with:
url: https://github.com/nicklockwood/SwiftFormat
- name: Run SwiftFormat
run: swiftformat .
- uses: EndBug/add-and-commit@v9
with:
author_name: botlockwood
default_author: github_actions
message: "ran swiftformat"
- name: Output Commit ID
id: output-commit
run: |
SHA=$(git rev-parse HEAD)
echo "commitSHA=$SHA" >> $GITHUB_OUTPUT
run-tests:
name: Run Tests on ${{ matrix.os }} with Swift ${{ matrix.swift-version }} Node ${{ matrix.node-version }}
needs: swift-format
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
node-version: ["19.1.0"]
swift-version: ["5.9"]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: "Tests"
steps:
- uses: actions/checkout@v3
with:
ref: ${{ needs.swift-format.outputs.commitSHA }}
- name: Install Swift ${{ matrix.swift-version }} on macOS/Linux
if: ${{ runner.os != 'Windows' }}
uses: swift-actions/setup-swift@v1
with:
swift-version: ${{ matrix.swift-version }}
- name: Install Swift ${{ matrix.swift-version }} on Windows
if: ${{ runner.os == 'Windows' }}
run: |
Install-Binary -Url "https://download.swift.org/swift-${{ matrix.swift-version }}-release/windows10/swift-${{ matrix.swift-version }}-RELEASE/swift-${{ matrix.swift-version }}-RELEASE-windows10.exe" -Name "installer.exe" -ArgumentList ("-q")
Add-Content $env:GITHUB_PATH "C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin"
Add-Content $env:GITHUB_PATH "C:\Program Files\swift\runtime-development\usr\bin"
Add-Content $env:GITHUB_PATH "C:\Program Files\swift\icu-69.1\usr\bin"
Add-Content $env:GITHUB_ENV "SDKROOT=C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk"
Add-Content $env:GITHUB_ENV "DEVELOPER_DIR=C:\Library\Developer"
- name: Enable MS Developer Command Prompt
if: ${{ runner.os == 'Windows' }}
uses: ilammy/msvc-dev-cmd@v1
- name: Install Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: "Tests/package-lock.json"
- name: Test
run: |
npm install
npm test