Switch Bobsled image to Openstates docker repo #39
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: Test Python | |
on: | |
push: | |
branches: [main, develop] | |
pull_request: | |
branches: [main, develop] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_DATABASE: test | |
POSTGRES_PASSWORD: test | |
POSTGRES_USER: test | |
POSTGRES_HOST_AUTH_METHOD: trust | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- uses: actions/checkout@v2 | |
# Python dependencies | |
- name: setup Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: install Poetry | |
uses: snok/[email protected] | |
- name: cache Poetry virtualenv | |
uses: actions/cache@v2 | |
id: poetry-cache | |
with: | |
path: ~/.virtualenvs/ | |
key: poetry-${{ hashFiles('**/poetry.lock') }} | |
restore-keys: | | |
poetry-${{ hashFiles('**/poetry.lock') }} | |
- name: set poetry config path | |
run: poetry config virtualenvs.path ~/.virtualenvs | |
- name: install python dependencies | |
run: poetry install | |
- name: lint with flake8 | |
run: poetry run flake8 --show-source --statistics --ignore=E203,E501,W503 | |
- name: pytest | |
run: poetry run pytest | |
env: | |
BOTO_CONFIG: /dev/null | |
AWS_DEFAULT_REGION: us-east-1 | |
BOBSLED_SECRET_KEY: "secret-stuff-here" | |
BOBSLED_TASKS_FILENAME: "bobsled/tests/tasks/tasks.yml" | |
BOBSLED_TEST_DATABASE: "postgresql://test:test@localhost/test" | |
BOBSLED_ENVIRONMENT_FILENAME: "bobsled/tests/environments.yml" |