From 23d8eecf751fb4dd045e4542e13dca859bd8391a Mon Sep 17 00:00:00 2001 From: "upx3 (CFA)" <127630341+AFg6K7h4fhy2@users.noreply.github.com> Date: Thu, 21 Nov 2024 15:00:40 -0500 Subject: [PATCH] Add CI Check For Testing Suite (#43) --- .github/actions/pre-commit/action.yaml | 2 +- .github/workflows/test.yaml | 35 ++++++++++++++++++++++++++ pyproject.toml | 4 +++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test.yaml diff --git a/.github/actions/pre-commit/action.yaml b/.github/actions/pre-commit/action.yaml index ffe64ee..1f86b74 100644 --- a/.github/actions/pre-commit/action.yaml +++ b/.github/actions/pre-commit/action.yaml @@ -1,4 +1,4 @@ -name: pre-commit +name: Pre-Commit description: run pre-commit inputs: extra_args: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..5efc8e1 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,35 @@ +name: Workflow For Tests In Forecasttools + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + install-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: cache poetry + uses: actions/cache@v4 + with: + path: ~/.local + key: ${{ runner.os }}-poetry + + - name: install poetry + run: pip install poetry + + - name: install package + run: poetry install --with test + + - name: run tests + run: | + poetry run pytest diff --git a/pyproject.toml b/pyproject.toml index 62faced..93cb5aa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,6 +41,10 @@ nbclient = "^0.10.0" jupyter = "^1.1.1" + +[tool.poetry.group.test.dependencies] +pytest = "^8.3.3" + [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api"