-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (50 loc) · 1.76 KB
/
CI.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
58
59
60
61
62
name: Tests
on:
push:
branches:
- main
pull_request:
jobs:
u-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- name: Checkout projeto
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Install PostgreSQL
run: |
sudo apt-get update
sudo apt-get install -y postgresql postgresql-contrib
- name: Start PostgreSQL
run: |
sudo service postgresql start
- name: Configure PostgreSQL
run: |
sudo -u postgres psql -c "CREATE DATABASE forunb_db;"
sudo -u postgres psql -c "CREATE USER forunb WITH PASSWORD 'balao123';"
sudo -u postgres psql -c "ALTER USER forunb CREATEDB;"
sudo -u postgres psql -c "ALTER ROLE forunb SET client_encoding TO 'utf8';"
sudo -u postgres psql -c "ALTER ROLE forunb SET default_transaction_isolation TO 'read committed';"
sudo -u postgres psql -c "ALTER ROLE forunb SET timezone TO 'UTC';"
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE forunb_db TO forunb;"
- name: Configure enviroment
run: make config
- name: Testing
run: python ./forunb/manage.py test forunb