Add fields to resource API #105
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: pytest | |
on: | |
push: | |
branches: | |
- main | |
# run CI only if files in these whitelisted paths are changed | |
paths: | |
- '.github/workflows/**' | |
- 'config/**' | |
- 'isimip_data/**' | |
- 'testing/**' | |
- 'requirements/**' | |
- conftest.py | |
pull_request: | |
jobs: | |
pytest: | |
runs-on: ubuntu-22.04 | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_PASSWORD: postgres_password | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install package | |
run: | | |
python3 -m pip install --upgrade pip setuptools | |
python3 -m pip install coveralls | |
python3 -m pip install -r requirements/development.txt | |
- name: Prepare database | |
run: | | |
psql postgres://postgres:postgres_password@localhost -c 'CREATE DATABASE test_isimip_data;' | |
psql postgres://postgres:postgres_password@localhost -c 'CREATE DATABASE test_isimip_metadata;' | |
psql postgres://postgres:postgres_password@localhost/test_isimip_metadata -f testing/sql/test_isimip_metadata.sql | |
- name: Setup config file | |
run: | | |
cp config/settings/environments/github.py config/settings/local.py | |
- name: Run pytest | |
run: | | |
pytest --reuse-db --cov=isimip_data | |
coveralls --service=github | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COVERALLS_PARALLEL: true | |
coveralls: | |
needs: pytest | |
runs-on: ubuntu-latest | |
container: python:3-slim | |
steps: | |
- name: Run coveralls finish | |
run: | | |
pip install coveralls | |
coveralls --service=github --finish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |