Skip to content

Fix PATH handling in WSL environment #14

Fix PATH handling in WSL environment

Fix PATH handling in WSL environment #14

Workflow file for this run

name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Setup WSL
if: matrix.os == 'windows-latest'
uses: Vampire/setup-wsl@v2
with:
distribution: Ubuntu-22.04
- name: Setup Mono/F# (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y fsharp
- name: Setup Mono/F# (macOS)
if: matrix.os == 'macos-latest'
run: |
brew install mono
- name: Setup Mono/F# (WSL)
if: matrix.os == 'windows-latest'
shell: wsl-bash {0}
run: |
sudo apt-get update
sudo apt-get install -y fsharp
- name: Make scripts executable and add to PATH
if: matrix.os != 'windows-latest'
run: |
chmod +x fsi
chmod +x test_fsi.fsx
echo "$GITHUB_WORKSPACE" >> $GITHUB_PATH
- name: Make scripts executable and add to PATH (WSL)
if: matrix.os == 'windows-latest'
shell: wsl-bash {0}
run: |
WORKSPACE_PATH="/mnt/d/a/fsi-cacher-runner/fsi-cacher-runner"
cd "$WORKSPACE_PATH"
chmod +x fsi
chmod +x test_fsi.fsx
export PATH="$WORKSPACE_PATH:$PATH"
- name: Run tests
if: matrix.os != 'windows-latest'
run: ./test_fsi.fsx
- name: Run tests (WSL)
if: matrix.os == 'windows-latest'
shell: wsl-bash {0}
run: ./test_fsi.fsx