mirror of
https://github.com/peeringdb/peeringdb.git
synced 2024-05-11 05:55:09 +00:00
53 lines
1.5 KiB
YAML
53 lines
1.5 KiB
YAML
name: tests
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
|
|
linting:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.9
|
|
- name: Install Poetry
|
|
uses: snok/install-poetry@v1
|
|
with:
|
|
virtualenvs-create: true
|
|
virtualenvs-in-project: true
|
|
installer-parallel: true
|
|
- name: Load cached venv
|
|
id: cached-poetry-dependencies
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: .venv
|
|
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
|
|
- name: Ensure cache is healthy
|
|
if: steps.cache.outputs.cache-hit == 'true'
|
|
shell: bash
|
|
run: timeout 10s poetry run pip --version || rm -rf .venv
|
|
# install dependencies if cache does not exist
|
|
- name: Check cache and install dependencies
|
|
run: poetry install --no-interaction --no-root
|
|
- name: Run linters
|
|
run: |
|
|
poetry run isort .
|
|
poetry run black . --check
|
|
# poetry run flake8 peeringdb_server
|
|
|
|
test:
|
|
needs: linting
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v2
|
|
- name: setup dev environment
|
|
run: touch ./Ctl/dev/.env
|
|
- name: Start the DB
|
|
run: ./Ctl/dev/compose.sh up -d database
|
|
- name: build PeeringDB
|
|
run: ./Ctl/dev/compose.sh build --pull peeringdb
|
|
- name: run tests
|
|
run: ./Ctl/dev/run.sh run_tests
|