1
0
mirror of https://github.com/peeringdb/peeringdb.git synced 2024-05-11 05:55:09 +00:00
Files
Matt Griswold b898dbe208 Update image build to fix tests (#1237)
* poetry lock

* always try new image pull

* add build deps to test stage
2022-09-09 11:36:55 -05:00

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