Skip to content

Commit 1007802

Browse files
author
Nabil Fayak
committed
pytest workflow implemented
1 parent ee29b20 commit 1007802

File tree

3 files changed

+45
-59
lines changed

3 files changed

+45
-59
lines changed

.github/workflows/linux_integration_tests.yaml

Lines changed: 0 additions & 59 deletions
This file was deleted.

.github/workflows/pytest.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Pytest Tests
2+
on:
3+
pull_request:
4+
types: [opened, synchronize]
5+
push:
6+
branches:
7+
- main
8+
jobs:
9+
lint_check:
10+
name: Python ${{ matrix.python_version }} lint test
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python_version: ["3.9"]
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
18+
with:
19+
ref: ${{ github.event.pull_request.head.ref }}
20+
repository: ${{ github.event.pull_request.head.repo.full_name }}
21+
- name: Set up python ${{ matrix.python_version }}
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: ${{ matrix.python_version }}
25+
cache: 'pip'
26+
cache-dependency-path: 'pyproject.toml'
27+
- uses: actions/cache@v3
28+
id: cache
29+
with:
30+
path: ${{ env.pythonLocation }}
31+
key: ${{ matrix.python_version }}-lint-${{ env.pythonLocation }}-${{ hashFiles('**/pyproject.toml') }}-v01
32+
- name: Install checkmate with dev requirements (not using cache)
33+
if: steps.cache.outputs.cache-hit != 'true'
34+
run: |
35+
python -m pip install -e .[dev]
36+
- name: Install checkmate with no requirements (using cache)
37+
if: steps.cache.outputs.cache-hit == 'true'
38+
run: |
39+
python -m pip install -e .[dev] --no-deps
40+
- name: Run Pytest
41+
run: make test

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ lint-fix:
2121
black . --config=./pyproject.toml
2222
ruff . --config=./pyproject.toml --fix
2323

24+
.PHONY: test
25+
test:
26+
pytest tests
27+
2428
.PHONY: installdeps
2529
installdeps:
2630
pip install --upgrade pip

0 commit comments

Comments
 (0)