From a565d9e580082bafdff0e80cee4d29d2f6f7aea4 Mon Sep 17 00:00:00 2001 From: deeplow Date: Wed, 4 Jan 2023 15:37:28 +0000 Subject: [PATCH] CI: add macOS and Winwdows tests via Github Actions Adds tests for macOS and Windows with the dummy converter. Tests won't actually perform the conversion. But it should be enough for us to test the remainder of the codebase. Fixes #229 --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ tests/__init__.py | 1 - tests/test_cli.py | 3 +++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6dc561b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: Tests +on: + push: + pull_request: + branches: [ main ] + +jobs: + windows: + runs-on: windows-latest + env: + DUMMY_CONVERSION: True + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + - run: pip install poetry + - run: poetry install + - name: Run CLI tests + run: poetry run make test + + macOS: + runs-on: macos-latest + env: + DUMMY_CONVERSION: True + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + - run: pip install poetry + - run: poetry install + - name: Run CLI tests + run: poetry run make test diff --git a/tests/__init__.py b/tests/__init__.py index ff9d57d..8fc7302 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,4 +1,3 @@ -import os import sys from pathlib import Path diff --git a/tests/test_cli.py b/tests/test_cli.py index eab1afc..4cf0c19 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -126,6 +126,9 @@ class TestCli(TestBase): # to tokenize it. args = (args,) + if os.environ.get("DUMMY_CONVERSION", False): + args = ("--unsafe-dummy-conversion", *args) + # TODO: Replace this with `contextlib.chdir()` [1], which was added in # Python 3.11. #