Skip to content

Commit

Permalink
Remove tox and use Github Actions (#453)
Browse files Browse the repository at this point in the history
  • Loading branch information
leplatrem authored Jan 19, 2024
1 parent 023bfba commit 2082194
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 79 deletions.
82 changes: 41 additions & 41 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
on:
push:
branches:
- master
pull_request:
name: Run CI checks

on: pull_request

permissions:
contents: read

name: Unit Testing
jobs:
chore:
name: Unit Tests
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4

- name: Install dependencies
run: make install

- name: Run linting and formatting checks
run: make lint

unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
toxenv: [py38, lint, functional]
include:
- toxenv: py38
python-version: "3.8"
- toxenv: lint
python-version: "3.X"
- toxenv: functional
python-version: "3.11"

python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-python@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml

- name: Install virtualenv
run: |
pip install virtualenv
virtualenv --python=python3 .venv
- name: Run unit tests
run: make test

- name: Print environment
run: |
source .venv/bin/activate
python --version
pip --version
functional-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install dependencies
run: |
source .venv/bin/activate
pip install tox
- uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Run Kinto
if: matrix.toxenv == 'functional'
run: |
source .venv/bin/activate
make run-kinto & sleep 5
- name: Install dependencies
run: make install

- name: Tox
run: |
source .venv/bin/activate
tox -e ${{ matrix.toxenv }}
- name: Run kinto
run: make run-kinto & sleep 5

- name: Run functional tests
run: make functional
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.cache
.tox
.coverage
.pytest_cache
.ruff_cache
Expand Down
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,15 @@ format: install
requirements.txt: requirements.in
pip-compile requirements.in

tests-once: install
tests: test
tests-once: test
test: install
$(VENV)/bin/py.test --cov-report term-missing --cov-fail-under 100 --cov kinto_emailer

tests: install
$(VENV)/bin/tox

clean:
find src/ -name '*.pyc' -delete
find src/ -name '__pycache__' -type d -exec rm -fr {} \;
rm -rf .tox $(VENV) mail/ *.egg-info .pytest_cache .ruff_cache .coverage build dist
rm -rf $(VENV) mail/ *.egg-info .pytest_cache .ruff_cache .coverage build dist

run-kinto: install
$(VENV)/bin/kinto start --ini tests/config/kinto.ini
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ dev = [
"pytest",
"pytest-cache",
"pytest-cov",
"tox",
"webtest",
]

Expand Down
31 changes: 0 additions & 31 deletions tox.ini

This file was deleted.

0 comments on commit 2082194

Please sign in to comment.