-
Notifications
You must be signed in to change notification settings - Fork 9
68 lines (68 loc) · 1.9 KB
/
deploy-coverage.yml
File metadata and controls
68 lines (68 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#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@v4
# - name: Set up Python 3.9
# uses: actions/setup-python@v5
# with:
# python-version: "3.9"
# - name: Set up poetry cache
# uses: actions/cache@v4
# 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@v3
# with:
# name: poetry-report
# path: poetry-report/
# 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@v4