Update sandbox.yml #58
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: shell-test | |
on: | |
push: | |
branches: | |
- shell-escape-space | |
workflow_dispatch: | |
# allow manual runs on branches without a PR | |
jobs: | |
shell-test: | |
name: shell test on ${{ matrix.runner }} | |
runs-on: ${{ matrix.runner }} | |
strategy: | |
fail-fast: false | |
matrix: | |
runner: ["ubuntu-latest", "macos-latest", "windows-latest"] | |
steps: | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: setup environment | |
shell: bash | |
id: setup | |
run: | | |
set -euxo pipefail | |
python -m venv 'venv A' | |
if [ -d './venv A/bin' ]; then | |
echo "python=$(pwd)/venv A/bin/python" >> "$GITHUB_OUTPUT" | |
else | |
echo "python=$(pwd)/venv A/Scripts/python.exe" >> "$GITHUB_OUTPUT" | |
fi | |
mkdir 'test A' | |
echo "print(__file__)" >> 'test A/test.py' | |
echo "test=$(pwd)/test A/test.py" >> "$GITHUB_OUTPUT" | |
- name: works with shell | |
shell: bash | |
run: "'${{ steps.setup.outputs.python }}' '${{ steps.setup.outputs.test }}'" |