-
Notifications
You must be signed in to change notification settings - Fork 2
52 lines (42 loc) · 1.35 KB
/
python-app.yml
File metadata and controls
52 lines (42 loc) · 1.35 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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python application
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install pytest
- name: Test with pytest
run: |
pip install pytest pytest-cov
pytest
# - name: Run tests with coverage
# run: pytest --cov=your_module tests/ --cov-report=xml
# - name: Generate coverage badge
# uses: cicirello/jacoco-badge-generator@v2.1.0
# with:
# coverage-files: coverage.xml
# badge-file: coverage-badge.svg
# - name: Commit coverage badge
# run: |
# git config --global user.email "shaziamuckram@gmail.com"
# git config --global user.name "shaziamuckram"
# git add coverage-badge.svg
# git commit -m "Update coverage badge"
# git push
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}