DRAFT: Add CFAIR Experiemts #122
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" ] | |
python-version: [ "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: | |
sudo apt-get update | |
- 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: install setuptools | |
run: pip${{ matrix.python-version }} install setuptools | |
- 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${{ matrix.python-version }} install -r requirements.txt | |
- name: Install pytest | |
run: pip${{ matrix.python-version }} install pytest | |
#---------------------------------------------- | |
# install your root project, if required | |
#---------------------------------------------- | |
- name: Install project | |
run: pip${{ matrix.python-version }} install -e . | |
#---------------------------------------------- | |
# add matrix specifics and run test suite | |
#---------------------------------------------- | |
- name: Run tests | |
run: | | |
pytest tests/ | |
#coverage report |