forked from ziotom78/instrumentdb
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (46 loc) · 1.69 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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