fix(result export): confidence set failed the campaign results export… #90
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: Deploy coverage | |
on: | |
push: | |
branches: [ master ] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
backend-coverage: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_USER: "postgres" | |
POSTGRES_PASSWORD: "postgres" | |
POSTGRES_DB: "postgres" | |
ports: | |
- 5432:5432 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.9" | |
- name: Set up poetry cache | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pypoetry/ | |
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} | |
restore-keys: | | |
${{ runner.os }}-poetry- | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
poetry install | |
- name: Run coverage | |
run: | | |
poetry run coverage run ./manage.py test &> /dev/null | |
mkdir -p ./_site/coverage | |
poetry run coverage html -d ./_site/coverage | |
- name: Get badge | |
run: | | |
PCT=`poetry run coverage report | tail -n1 | tr -s ' ' | cut -d ' ' -f 6 | tr -d '%'` | |
COLOR="success"; if (( $PCT < 95)); then COLOR=yellow; fi | |
curl https://img.shields.io/badge/coverage-${PCT}%25-${COLOR} > ./_site/coverage/badge.svg | |
- name: Upload coverage artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
retention-days: "90" | |
deploy-coverage: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: backend-coverage | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |