Skip to content

Commit

Permalink
Run tests with CRT
Browse files Browse the repository at this point in the history
  • Loading branch information
nateprewitt committed Nov 23, 2023
1 parent a5f36d3 commit abc90a2
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/run-crt-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Run CRT tests

on:
push:
pull_request:
branches-ignore: [master]

permissions:
contents: read

jobs:
build:
runs-on: '${{ matrix.os }}'
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- name: 'Set up Python ${{ matrix.python-version }}'
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1
with:
python-version: '${{ matrix.python-version }}'
- name: Install dependencies and CRT
run: |
python scripts/ci/install --extras crt
- name: Run tests
run: |
python scripts/ci/run-crt-tests --with-cov --with-xdist
14 changes: 13 additions & 1 deletion scripts/ci/install
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python
import argparse
import os
import shutil
from contextlib import contextmanager
Expand All @@ -25,11 +26,22 @@ def run(command):


if __name__ == "__main__":
parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group()
group.add_argument(
'-e',
'--extras',
help='Install extras_require along with normal install',
)
args = parser.parse_args()
with cd(REPO_ROOT):
run("pip install -r requirements.txt")
run("python scripts/ci/install-dev-deps")
if os.path.isdir("dist") and os.listdir("dist"):
shutil.rmtree("dist")
run("python setup.py bdist_wheel")
wheel_dist = os.listdir("dist")[0]
run("pip install %s" % (os.path.join("dist", wheel_dist)))
package = os.path.join('dist', wheel_dist)
if args.extras:
package = f"\"{package}[{args.extras}]\""
run(f"pip install {package}")
3 changes: 2 additions & 1 deletion scripts/ci/run-crt-tests
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ except ImportError:

if __name__ == "__main__":
with cd(os.path.join(REPO_ROOT, "tests")):
run(f"{REPO_ROOT}/scripts/ci/run-tests unit/ functional/")
test_script = os.sep.join([REPO_ROOT, 'scripts', 'ci', 'run-tests'])
run(f"python {test_script} unit functional")

0 comments on commit abc90a2

Please sign in to comment.