Skip to content

Merge branch 'ziotom78:master' into master #29

Merge branch 'ziotom78:master' into master

Merge branch 'ziotom78:master' into master #29

Workflow file for this run

name: Tests
on: [push]
jobs:
tests:
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
os: [ubuntu-latest]
python: ["3.8", "3.9", "3.10", "3.11"]
steps:
- name: "Checkout the repository"
uses: actions/checkout@v2
- name: "Setup Python"
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: "Upgrade pip"
run: pip install --upgrade pip
- name: "Install Poetry and export dependencies to requirements.txt"
run: |
export POETRY_HOME=/opt/poetry
python3 -m venv $POETRY_HOME
$POETRY_HOME/bin/pip install poetry==1.5.1
$POETRY_HOME/bin/poetry --version
$POETRY_HOME/bin/poetry export --without-hashes -o requirements.txt
- name: "Install dependencies using pip"
run: |
pip install -r requirements.txt
- name: "Check that the code is formatted using black"
run: black --check --diff .
- name: "Run flake8"
run: python3 -m flake8
- name: "Create a configuration file for Django"
run: |
export DB_PATH=$HOME/db
mkdir -p $DB_PATH
cp .env.example .env
sed -i 's/SECRET_KEY=""/SECRET_KEY="deadmeat"/g' .env
sed -i 's/LOG_FILE_PATH=.*/LOG_FILE_PATH=$DB_PATH\/mylog.txt/g' .env
sed -i 's/STORAGE_PATH=.*/STORAGE_PATH=$DB_PATH\/storage/g' .env
sed -i 's/STORAGE_PATH=.*/DATABASE_URL=$DB_PATH\/storage\/instrumentdb.sqlite3/g' .env
sed -i 's/STATIC_PATH=.*/STORAGE_PATH=$DB_PATH\/storage\/static/g' .env
cat .env
- name: "Run tests"
run: python3 manage.py test