-
Notifications
You must be signed in to change notification settings - Fork 16
51 lines (47 loc) · 1.35 KB
/
run-python-tests.yaml
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
# This workflow will install Python dependencies, lint and run tests
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Run tests
on:
workflow_dispatch: # add run button in github
push:
branches-ignore:
- gh-pages
- 'dependabot/**'
pull_request:
branches-ignore:
- gh-pages
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade hatch
- name: Test with hatch/pytest
env:
HDX_KEY_TEST: ${{ secrets.HDX_BOT_SCRAPERS_API_TOKEN }}
GSHEET_AUTH: ${{ secrets.GSHEET_AUTH }}
run: |
hatch run test:test
- name: Check styling
if: always()
run: |
hatch run lint:style
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
junit_files: test-results.xml
- name: Publish in Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: tests
format: lcov