Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable WSL testing of mise #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 44 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ concurrency:

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WSLENV: HOSTNAME:CI:GITHUB_ACTION:GITHUB_ACTION_PATH/p:GITHUB_ACTION_REPOSITORY:GITHUB_WORKFLOW:GITHUB_WORKSPACE/p:GITHUB_PATH/p:GITHUB_ENV/p:VIRTUAL_ENV/p

jobs:
build:
Expand All @@ -30,8 +31,50 @@ jobs:
- ubuntu-24.04
- macos-15
- macos-14
include:
- os: windows-2022
wsl: true
name: wsl (2022)
shell: wsl-bash {0}
# disabled due to https://github.com/Vampire/setup-wsl/issues/65
# - os: windows-2025
# wsl: true
# name: wsl (2025)
# shell: wsl-bash {0}
steps:

- name: Prepare PATH for mise shims on Windows
if: runner.os == 'Windows'
# override to ensure that bash is not accidentally used for this one
shell: powershell
run: |
echo "${env:LOCALAPPDATA}\mise\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "${env:LOCALAPPDATA}\mise\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: Install mise
uses: jdx/mise-action@v2

- if: matrix.wsl
uses: Vampire/setup-wsl@v4
with:
additional-packages: curl
distribution: Ubuntu-22.04
set-as-default: "true"
# '-i' seems to be the only option that loads .bashrc file that we need
# https://github.com/Vampire/setup-wsl/discussions/54
wsl-shell-command: "bash -i -eo pipefail"
# https://github.com/MicrosoftDocs/WSL/blob/main/WSL/wsl-config.md#L159
wsl-conf: |
[automount]
enabled = true
root = /
options = "metadata,umask=077"
[interop]
enabled = true
appendWindowsPath = true
[network]
hostname = wsl

- uses: actions/checkout@v4
with:
fetch-depth: 0 # needed by setuptools-scm
Expand All @@ -41,16 +84,14 @@ jobs:
- name: Show info about default shell used by github runners
run: |
set -euxo pipefail
echo "PATH=$PATH"
pwd
ls
echo $SHELL
id
type curl
type sh

- name: Install mise
uses: jdx/mise-action@v2

- name: Install mise extra python packages
run: |
mise exec --command "python3 -m pip install -r .default-python-packages"
Expand Down
Loading