From 67cfbe5c4b59f4fa1bf3917ac07257faa74a3427 Mon Sep 17 00:00:00 2001 From: Jeremy Kun Date: Mon, 18 Mar 2024 16:05:36 -0700 Subject: [PATCH] add CI and pyproject config for pytest --- .github/workflows/scripts_test.yml | 31 ++++++++++++++++++++++++++++++ pyproject.toml | 15 +++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .github/workflows/scripts_test.yml create mode 100644 pyproject.toml diff --git a/.github/workflows/scripts_test.yml b/.github/workflows/scripts_test.yml new file mode 100644 index 000000000..be40ac561 --- /dev/null +++ b/.github/workflows/scripts_test.yml @@ -0,0 +1,31 @@ +name: Scripts tests +permissions: read-all +on: + push: + branches: + - main + pull_request: + branches: + - main +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true +jobs: + build-and-test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.11"] + steps: + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # pin@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # pin@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements-dev.txt + - name: Run tests + run: | + python -m pytest diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..173b912c8 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,15 @@ +[tool.pytest.ini_options] +norecursedirs = [ + ".git", + "__pycache__", + "bazel", + "bazel-bin", + "bazel-heir", + "bazel-out", + "bazel-testlogs", + "docs", + "external", + "tests", + "tools", + "venv", +]