Add sudo to test setup command in CI workflow #24
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: Testing | |
on: | |
pull_request: | |
push: | |
branches: ["*"] | |
paths-ignore: | |
- 'docs/**' | |
- '*.md' | |
- '*.rst' | |
tags-ignore: ["*"] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:${{ matrix.postgres }} | |
env: | |
POSTGRES_PASSWORD: postgres | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432 | |
strategy: | |
fail-fast: true | |
matrix: | |
python: ["3.11"] #, "3.12", "3.13"] | |
postgres: [14] #, 15, 16, 17] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v1 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '${{ matrix.python }}' | |
- name: Setup environment | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y bash cargo gcc git libffi-dev libpq-dev build-essential postgresql postgresql-server-dev-16 rustc tzdata | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e '.[dev]' | |
- name: Setup test/fixture data | |
run: sudo ci/test-setup | |
- name: Run tests | |
run: ci/test | |
env: | |
NOBOOTSTRAP: true | |
POSTGRES_URI: postgresql://postgres@postgres:5432/postgres | |
- name: Upload Coverage | |
uses: codecov/codecov-action@v1 | |
with: | |
file: build/coverage.xml |