Enable WSL testing of mise #23
This file contains 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: test | |
on: | |
push: # only publishes pushes to the main branch to TestPyPI | |
branches: # any integration branch but not tag | |
- main | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
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: | |
name: ${{ matrix.name || matrix.os }} | |
runs-on: ${{ matrix.os || 'ubuntu-24.04' }} | |
defaults: | |
run: | |
shell: ${{ matrix.shell || 'bash'}} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: # https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners | |
- 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 | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # needed by setuptools-scm | |
submodules: true | |
- 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 extra python packages | |
run: | | |
mise exec --command "python3 -m pip install -r .default-python-packages" | |
mise reshim | |
- name: Valdate mise availability | |
run: | | |
set -euxo pipefail | |
type -a mise | |
mise --version | |
mise doctor | |
mise ls | |
mise exec --command "python3 --version" | |
mise exec --command "python3 -m pip --version" | |
mise exec --command "python3 -m tox --version" | |
mise exec --command "gh --version" | |
mise exec --command "task --version" | |
type -a python3 | |
type -a pip3 | |
type -a gh | |
type -a task | |
type -a node | |
type -a tox | |
tox --version |