2022-06-15 02:04:34 +02:00
|
|
|
name: Python CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
dependencies:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Setup Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: '3.9.5'
|
|
|
|
- name: Cache dependencies
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.m2/repository
|
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pip-
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pip3 install -r requirements.txt -r requirements-dev.txt
|
|
|
|
tests:
|
|
|
|
needs: [dependencies]
|
|
|
|
runs-on: ubuntu-latest
|
2022-06-17 00:43:55 +02:00
|
|
|
services:
|
|
|
|
postgres:
|
|
|
|
image: postgres:14
|
|
|
|
env:
|
|
|
|
POSTGRES_DB: didier_action
|
2022-06-17 00:47:10 +02:00
|
|
|
POSTGRES_PASSWORD: postgres
|
2022-06-17 00:43:55 +02:00
|
|
|
options: >-
|
|
|
|
--health-cmd pg_isready
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
ports:
|
|
|
|
- 5432:5432
|
2022-06-15 02:04:34 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Setup Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: '3.9.5'
|
|
|
|
- name: Cache dependencies
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.m2/repository
|
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pip-
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pip3 install -r requirements.txt -r requirements-dev.txt
|
|
|
|
- name: Run Pytest
|
|
|
|
run: pytest tests
|
2022-06-17 00:43:55 +02:00
|
|
|
env:
|
|
|
|
DB_TEST_SQLITE: false
|
|
|
|
DB_NAME: didier_action
|
2022-06-17 00:47:10 +02:00
|
|
|
DB_PASSWORD: postgres
|
2022-06-15 02:04:34 +02:00
|
|
|
linting:
|
2022-06-16 00:31:34 +02:00
|
|
|
needs: [dependencies]
|
2022-06-15 02:04:34 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Setup Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: '3.9.5'
|
|
|
|
- name: Cache dependencies
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.m2/repository
|
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pip-
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pip3 install -r requirements.txt -r requirements-dev.txt
|
|
|
|
- name: Linting
|
|
|
|
run: pylint didier database
|
|
|
|
typing:
|
2022-06-16 00:31:34 +02:00
|
|
|
needs: [dependencies]
|
2022-06-15 02:04:34 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Setup Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: '3.9.5'
|
|
|
|
- name: Cache dependencies
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.m2/repository
|
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pip-
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pip3 install -r requirements.txt -r requirements-dev.txt
|
|
|
|
- name: Typing
|
|
|
|
run: mypy didier database
|
|
|
|
formatting:
|
2022-06-16 00:31:34 +02:00
|
|
|
needs: [dependencies]
|
2022-06-15 02:04:34 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Setup Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: '3.9.5'
|
|
|
|
- name: Cache dependencies
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.m2/repository
|
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pip-
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pip3 install -r requirements.txt -r requirements-dev.txt
|
|
|
|
- name: Formatting
|
|
|
|
run: black --check didier database
|