From 5ad8bc591e3c1bd8b99134338c51f5865c160fa0 Mon Sep 17 00:00:00 2001 From: Yuya Sugie Date: Sun, 5 Nov 2023 12:31:33 +0900 Subject: [PATCH] Create test environment (#146) --- .github/workflows/test.yml | 30 ++++++++++++++++++++++++++++++ setup.cfg | 1 + tests/test_hello.py | 9 +++++++++ 3 files changed, 40 insertions(+) create mode 100644 .github/workflows/test.yml create mode 100644 tests/test_hello.py diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..42cd6ad --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,30 @@ +name: test + +on: [push, pull_request] + +jobs: + test: + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + python-version: [3.8, 3.9] + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + pip3 install --upgrade setuptools + pip3 install .[dev] + + - name: Run tests + run: | + ss-manager -h + pytest -v + shell: bash diff --git a/setup.cfg b/setup.cfg index ba20a55..ebeb452 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,6 +18,7 @@ dev = isort black mypy + pytest [flake8] max-line-length = 100 diff --git a/tests/test_hello.py b/tests/test_hello.py new file mode 100644 index 0000000..bf8cc89 --- /dev/null +++ b/tests/test_hello.py @@ -0,0 +1,9 @@ +import pytest + + +def hello(): + return "Hello, world!" + + +def test_hello(): + assert hello() == "Hello, world!"