add missing import #30
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Taken from https://github.com/marketplace/actions/install-poetry-action#testing-using-a-matrix | |
name: test | |
on: pull_request | |
jobs: | |
linting: | |
runs-on: ubuntu-latest | |
steps: | |
#---------------------------------------------- | |
# check-out repo and set-up python | |
#---------------------------------------------- | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
#---------------------------------------------- | |
# load pip cache if cache exists | |
#---------------------------------------------- | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip | |
restore-keys: ${{ runner.os }}-pip | |
#---------------------------------------------- | |
# install and run linters | |
#---------------------------------------------- | |
- run: python -m pip install black flake8 isort | |
#- run: | | |
# flake8 . | |
# black . --check | |
# isort . | |
test: | |
needs: linting | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ "ubuntu-latest", "macos-latest" ] | |
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] | |
django-version: ["3", "4" ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
#---------------------------------------------- | |
# check-out repo and set-up python | |
#---------------------------------------------- | |
- name: update apt | |
run: | |
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then | |
sudo apt-get update | |
fi | |
- name: install distutils | |
run: sudo apt install python${{ matrix.python-version }}-distutils | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Set up python ${{ matrix.python-version }} | |
id: setup-python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Build requirments.txt | |
uses: divideprojects/poetry-export-requirements-action@v1 | |
with: | |
without-hashes: true | |
outfile-name: requirements.txt | |
#---------------------------------------------- | |
# install dependencies if cache does not exist | |
#---------------------------------------------- | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Install pytest | |
run: pip install pytest | |
#---------------------------------------------- | |
# install your root project, if required | |
#---------------------------------------------- | |
- name: Install project | |
run: pip install -e . | |
#---------------------------------------------- | |
# add matrix specifics and run test suite | |
#---------------------------------------------- | |
- name: Run tests | |
run: | | |
pytest tests/ | |
#coverage report |