Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtmckee committed Sep 27, 2023
0 parents commit 4eadf7e
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
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: "Show environment (python versions)"
shell: "bash"
run: |
find "$RUNNER_TOOL_CACHE/Python" "$RUNNER_TOOL_CACHE/PyPy" -mindepth 4 -maxdepth 4 -name 'python' | while read path; do
"$path" identify.py
done
34 changes: 34 additions & 0 deletions identify.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from __future__ import print_function

import sys


def main():
python_version = ".".join(str(v) for v in sys.version_info[:3])
architecture = "x86"
if sys.maxsize > 2 ** 32:
architecture = "x64"

# PyPy
if hasattr(sys, "pypy_version_info"):
implementation = "PyPy"
implementation_version = ".".join(str(v) for v in sys.pypy_version_info[:3])

print(
"Python {0} ({1}) [{2} {3}]".format(
python_version,
architecture,
implementation,
implementation_version,
)
)

# CPython
else:
print("CPython {0} ({1})".format(python_version, architecture))

return 0


if __name__ == "__main__":
sys.exit(main())

0 comments on commit 4eadf7e

Please sign in to comment.