expiriment with env variables #13
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: CodeCov | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Test OneSilaHeadless | |
services: | |
postgres: | |
image: postgres:12 | |
env: | |
POSTGRES_USER: fake | |
POSTGRES_PASSWORD: fake | |
POSTGRES_DB: fake | |
ports: | |
- 5432:5432 | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11' | |
- name: Install requirements | |
run: pip install -r requirements.txt | |
- name: Install OS dependencies | |
run: sudo apt-get install postgresql | |
- name: Run tests and collect coverage | |
env: | |
POSTGRES_HOST: localhost | |
POSTGRES_USER: fake | |
POSTGRES_PASSWORD: fake | |
POSTGRES_DB: fake | |
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }} | |
run: cd OneSila && coverage run --source='.' manage.py test | |
- name: Upload coverage reports to Codecov with GitHub Action | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |