diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4e05cc3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +--- +name: Test + +on: + pull_request: + push: + branches: + - master + workflow_dispatch: + +jobs: + Build: + name: KiCAD ${{ matrix.kicad-version }} + + strategy: + matrix: + os: + - Ubuntu + kicad-version: + - "8.0" + - "9.0" + + runs-on: ${{ matrix.os }}-latest + container: + image: kicad/kicad:${{ matrix.kicad-version }} + options: --user root + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up build environment + shell: bash + run: | + apt update && apt install -y python3-pip + python3 -m pip install --break-system-packages --upgrade hatch + + - name: Test + run: hatch -v run pytest -vv tests + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false diff --git a/pyproject.toml b/pyproject.toml index fe32394..8c4f22c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,12 @@ path = "InteractiveHtmlBom/version.py" pattern = "LAST_TAG = 'v(?P[^']+)'" [tool.hatch.envs.default] -dependencies = ["coverage[toml]>=6.5", "pytest"] +system-packages = true +dependencies = [ + "coverage[toml]>=6.5", + "pytest", + "pytest-sugar" +] [tool.hatch.envs.default.scripts] test = "pytest {args:tests}" test-cov = "coverage run -m pytest {args:tests}" diff --git a/tests/test_module.py b/tests/test_module.py new file mode 100644 index 0000000..231b2aa --- /dev/null +++ b/tests/test_module.py @@ -0,0 +1,2 @@ +def test_module_import(): + import InteractiveHtmlBom # noqa