Skip to content

Commit

Permalink
Update the CI config to use pre-commit instead of tox
Browse files Browse the repository at this point in the history
  • Loading branch information
fsouza committed Aug 15, 2023
1 parent 7250437 commit 517c363
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 29 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ jobs:
- name: Install test dependencies
run: pip install tox

# Lint before running unit tests
- name: Run lint
run: tox -e lint

- name: Run tests
run: |
tox -e tests -- -n 4 tests/test_browser.py tests/test_element_list.py tests/test_request_handler.py tests/test_xpath_concat.py
Expand All @@ -59,8 +55,6 @@ jobs:
strategy:
matrix:
include:
- PY_VER: py37
python-version: 3.7
- PY_VER: py38
python-version: 3.8
- PY_VER: py39
Expand Down Expand Up @@ -101,8 +95,6 @@ jobs:
strategy:
matrix:
include:
- PY_VER: py37
python-version: 3.7
- PY_VER: py38
python-version: 3.8
- PY_VER: py39
Expand All @@ -125,3 +117,24 @@ jobs:
- name: Run Selenium tests
run: |
tox -e tests_selenium -- -n 4 tests/test_element_is_visible.py tests/test_screenshot.py tests/test_shadow_root.py tests/test_mouse_interaction.py tests/test_async_finder.py tests/test_html_snapshot.py tests/test_iframes.py tests/test_popups.py tests/test_webdriver.py tests/test_webdriver_firefox.py tests/test_webdriver_chrome.py;
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: 3.x

- name: install pre-commit
run: pip install pre-commit

- name: pre-commit cache
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: "pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}"
restore-keys: "pre-commit-"

- run: pre-commit run --all-files --show-diff-on-failure
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ test: dependencies clean
@echo "Running all tests..."
tox -- $(which)

format: clean dependencies
@flake8 --max-line-length 110 ./splinter ./tests

coverage: dependencies clean
@echo "Running all tests with coverage..."
@coverage run run_tests.py -w $(which) && coverage report
Expand Down
6 changes: 0 additions & 6 deletions requirements/lint.txt

This file was deleted.

12 changes: 0 additions & 12 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
[flake8]
max-line-length = 120
exclude =
docs
.tox


[testenv:tests]
extras = zope.testbrowser, django, flask
deps = -rrequirements/test.txt
Expand All @@ -28,8 +21,3 @@ passenv =
EDGEWEBDRIVER
commands=
pytest -v {posargs}


[testenv:lint]
deps = -rrequirements/lint.txt
commands = flake8

0 comments on commit 517c363

Please sign in to comment.