-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: use matrix for Python versions (#120)
With this change, we can use the install-python action for installing Python on all supported platforms.
- Loading branch information
Showing
5 changed files
with
114 additions
and
41 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,16 @@ concurrency: | |
jobs: | ||
tests-linux: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
name: Tests on Linux | ||
matrix: | ||
python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] | ||
|
||
env: | ||
AUSTIN_TESTS_PYTHON_VERSIONS: ${{ matrix.python-version }} | ||
|
||
name: Tests on Linux with Python ${{ matrix.python-version }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
|
@@ -22,9 +29,22 @@ jobs: | |
sudo apt-get -y install \ | ||
valgrind \ | ||
gdb \ | ||
python2.7 \ | ||
python3.{5..11} \ | ||
python3.10-full | ||
python${{ matrix.python-version }} \ | ||
python3.10{,-full} | ||
# Using these actions lead to Python binaries that cause SIGSEGV during | ||
# C unit tests. See | ||
# https://github.com/actions/setup-python/issues/442. | ||
|
||
# - name: Install Python | ||
# uses: actions/setup-python@v4 | ||
# with: | ||
# python-version: ${{ matrix.python-version }} | ||
|
||
# - name: Install Python 3.10 | ||
# uses: actions/setup-python@v4 | ||
# with: | ||
# python-version: "3.10" | ||
|
||
- name: Compile Austin | ||
run: | | ||
|
@@ -39,42 +59,59 @@ jobs: | |
source .venv/bin/activate | ||
pip install --upgrade pip | ||
pip install -r test/requirements.txt | ||
.venv/bin/pytest --pastebin=failed --no-flaky-report -sr a -n auto | ||
sudo .venv/bin/pytest --pastebin=failed --no-flaky-report -sr a -n auto | ||
sudo -E .venv/bin/pytest --pastebin=failed --no-flaky-report -sr a | ||
.venv/bin/pytest --pastebin=failed --no-flaky-report -sr a | ||
deactivate | ||
tests-osx: | ||
runs-on: macos-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
name: Tests on macOS | ||
matrix: | ||
python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] | ||
|
||
env: | ||
AUSTIN_TESTS_PYTHON_VERSIONS: ${{ matrix.python-version }} | ||
|
||
name: Tests on macOS with Python ${{ matrix.python-version }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Compile Austin | ||
run: gcc -Wall -O3 -g src/*.c -o src/austin | ||
|
||
- name: Install test dependencies | ||
run: | | ||
brew update | ||
brew install [email protected] | ||
brew install [email protected] | ||
brew install [email protected] | ||
brew install [email protected] | ||
- name: Install Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }}-dev | ||
|
||
- name: Install Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Run tests | ||
run: | | ||
$(brew --prefix)/opt/[email protected]/bin/python3 -m venv .venv | ||
python3.10 -m pip install --upgrade pip | ||
python3.10 -m pip install -r test/requirements.txt | ||
python${{ matrix.python-version }} -m venv .venv \ | ||
|| (python${{ matrix.python-version }} -m pip install virtualenv && python${{ matrix.python-version }} -m virtualenv .venv) | ||
source .venv/bin/activate | ||
pip install --upgrade pip | ||
pip install -r test/requirements.txt | ||
sudo .venv/bin/pytest --ignore=test/cunit --pastebin=failed --no-flaky-report -sr a -n auto | ||
sudo -E pytest --ignore=test/cunit --pastebin=failed --no-flaky-report -sr a | ||
deactivate | ||
tests-win: | ||
runs-on: windows-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
name: Tests on Windows | ||
matrix: | ||
python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] | ||
|
||
env: | ||
AUSTIN_TESTS_PYTHON_VERSIONS: ${{ matrix.python-version }} | ||
|
||
name: Tests on Windows with Python ${{ matrix.python-version }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
|
@@ -83,27 +120,21 @@ jobs: | |
gcc.exe -O3 -g -o src/austin.exe src/*.c -lpsapi -lntdll -Wall | ||
src\austin.exe --help | ||
- name: Install Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }}-dev | ||
|
||
- uses: actions/setup-python@v2 | ||
name: Setup Python | ||
name: Install Python 3.10 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install test dependencies | ||
run: | | ||
choco install python --no-progress -y --version=2.7.11 | ||
choco install python --no-progress -y --version=3.5.4 | ||
choco install python --no-progress -y --version=3.6.8 | ||
choco install python --no-progress -y --version=3.7.9 | ||
choco install python --no-progress -y --version=3.8.10 | ||
choco install python --no-progress -y --version=3.9.10 | ||
choco install python --no-progress -y --version=3.11.0-b3 --pre | ||
refreshenv | ||
- name: Run tests | ||
run: | | ||
py -3.10 -m venv venv | ||
venv\Scripts\Activate.ps1 | ||
python -m pip install --upgrade pip | ||
python -m pip install -r test/requirements.txt | ||
python -m pytest --ignore=test\cunit --pastebin=failed --no-flaky-report -sr a -n auto | ||
python -m pytest --ignore=test\cunit --pastebin=failed --no-flaky-report -sr a | ||
deactivate |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,23 @@ | ||
import os | ||
import platform | ||
|
||
PY3_LATEST = 11 | ||
|
||
try: | ||
REQUESTED_PYTHON_VERSIONS = [ | ||
tuple(int(_) for _ in v.split(".")) | ||
for v in os.getenv("AUSTIN_TESTS_PYTHON_VERSIONS", "").split(",") | ||
] | ||
except Exception: | ||
REQUESTED_PYTHON_VERSIONS = None | ||
|
||
|
||
match platform.system(): | ||
case "Darwin": | ||
PYTHON_VERSIONS = [(3, _) for _ in range(7, PY3_LATEST + 1)] | ||
PYTHON_VERSIONS = REQUESTED_PYTHON_VERSIONS or [ | ||
(3, _) for _ in range(7, PY3_LATEST + 1) | ||
] | ||
case _: | ||
PYTHON_VERSIONS = [(2, 7)] + [(3, _) for _ in range(5, PY3_LATEST + 1)] | ||
PYTHON_VERSIONS = REQUESTED_PYTHON_VERSIONS or [(2, 7)] + [ | ||
(3, _) for _ in range(5, PY3_LATEST + 1) | ||
] |
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
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