Skip to content

Commit fabc957

Browse files
committed
Add a new workflow that tests proxy methods only on push to main
1 parent 46c5143 commit fabc957

1 file changed

Lines changed: 67 additions & 0 deletions

File tree

.github/workflows/proxytests.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Python package (with methods that need proxy)
5+
6+
on:
7+
workflow_run:
8+
workflows: ["lint"]
9+
branches: [main]
10+
types:
11+
- completed
12+
pull_request:
13+
branches: [main]
14+
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 180
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
python-version: [3.8]
24+
25+
steps:
26+
- uses: actions/checkout@v3
27+
- name: Set up Python ${{ matrix.python-version }}
28+
uses: actions/setup-python@v3
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
- name: Install dependencies
32+
run: |
33+
python3 -m pip install --upgrade pip
34+
pip3 install -r requirements-dev.txt
35+
pip3 install -r requirements.txt
36+
#- name: Typilus, Suggest Python Type Annotations
37+
# uses: typilus/typilus-action@v0.9
38+
- name: Run unittests
39+
id: unittests
40+
if: ${{ github.event.pull_request.draft == false }}
41+
continue-on-error: true
42+
env:
43+
CONNECTION_METHOD: ${{ secrets.CONNECTION_METHOD }}
44+
PASSWORD: ${{ secrets.PASSWORD }}
45+
PORT: ${{ secrets.PORT }}
46+
USERNAME: ${{ secrets.USERNAME }}
47+
SCRAPER_API_KEY: ${{ secrets.SCRAPER_API_KEY }}
48+
run: |
49+
coverage run -m unittest -v test_module.TestScholarlyWithProxy
50+
- name: Generate coverage report
51+
if:
52+
"matrix.os == 'macos-latest'"
53+
run: |
54+
curl --data-binary @.github/.codecov.yml https://codecov.io/validate | head -n 1
55+
coverage xml
56+
- name: Upload code coverage
57+
uses: codecov/codecov-action@v2
58+
with:
59+
directory: ./
60+
fail_ci_if_error: false
61+
files: ./coverage.xml
62+
flags: unittests
63+
name: codecov-umbrella
64+
verbose: true
65+
- name: Check if unittests failed
66+
if: "steps.unittests.outcome == 'failure'"
67+
run: exit 1

0 commit comments

Comments
 (0)