WIP #26
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: | ||
branches: | ||
- "main" | ||
jobs: | ||
test: | ||
name: "Test on ${{ matrix.config.os-name }}" | ||
runs-on: "${{ matrix.config.runner }}" | ||
strategy: | ||
matrix: | ||
config: | ||
- os-name: "Linux" | ||
runner: "ubuntu-latest" | ||
test-label: "ci-test-linux" | ||
- os-name: "macOS" | ||
runner: "macos-latest" | ||
test-label: "ci-test-macos" | ||
- os-name: "Windows" | ||
runner: "windows-latest" | ||
test-label: "ci-test-windows" | ||
fail-fast: false | ||
steps: | ||
- name: "Show environment (pre)" | ||
shell: "bash" | ||
run: env | sort | ||
- name: "Checkout" | ||
uses: "actions/checkout@v4" | ||
- name: "Setup Python" | ||
id: "setup-python" | ||
uses: "actions/setup-python@v4" | ||
with: | ||
python-version: | | ||
3.7 | ||
3.8 | ||
3.9 | ||
3.10 | ||
3.11 | ||
pypy-3.9 | ||
pypy-3.10 | ||
3.12 | ||
allow-prereleases: true | ||
- name: "Show environment (post)" | ||
shell: "bash" | ||
run: env | sort | ||
- name: "Linux / macOS" | ||
if: "{{ runner.os }} != 'windows'" | ||
Check failure on line 54 in .github/workflows/test.yaml GitHub Actions / TestInvalid workflow file
|
||
shell: "bash" | ||
run: | | ||
find "$RUNNER_TOOL_CACHE/Python" "$RUNNER_TOOL_CACHE/PyPy" -mindepth 4 -maxdepth 4 -name 'python' | while read path; do | ||
# Architecture | ||
if [[ "$path" =~ /x64/ ]]; then | ||
architecture="x64" | ||
else | ||
architecture="x86" | ||
fi | ||
# Python version | ||
version="$(echo $path | grep -oE '[0-9]+\.[0-9]+\.[^/]+')" | ||
# PyPy | ||
if [[ "$path" =~ /PyPy/ ]]; then | ||
implementation="$("${path}" -V 2>&1 | grep -oE 'PyPy [^ ]+')" | ||
echo "Python ${version} (${architecture}) [${implementation}]" | ||
# CPython | ||
else | ||
echo "CPython ${version} (${architecture})" | ||
fi | ||
done | ||
- name: "Windows" | ||
if: "{{ runner.os }} == 'windows'" | ||
shell: "powershell" | ||
run: | | ||
Get-ChildItem -Path "$env:RUNNER_TOOL_CACHE" -Filter "python.exe" -Recurse -ErrorAction SilentlyContinue -Force |