|
| 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 | + push: |
| 8 | + branches: main |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + timeout-minutes: 180 |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + python-version: [3.8] |
| 18 | + |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v3 |
| 21 | + - name: Set up Python ${{ matrix.python-version }} |
| 22 | + uses: actions/setup-python@v3 |
| 23 | + with: |
| 24 | + python-version: ${{ matrix.python-version }} |
| 25 | + - name: Install dependencies |
| 26 | + run: | |
| 27 | + python3 -m pip install --upgrade pip |
| 28 | + pip3 install -r requirements.txt |
| 29 | + #- name: Typilus, Suggest Python Type Annotations |
| 30 | + # uses: typilus/typilus-action@v0.9 |
| 31 | + - name: Run unittests |
| 32 | + id: unittests |
| 33 | + continue-on-error: true |
| 34 | + env: |
| 35 | + CONNECTION_METHOD: ${{ secrets.CONNECTION_METHOD }} |
| 36 | + PASSWORD: ${{ secrets.PASSWORD }} |
| 37 | + PORT: ${{ secrets.PORT }} |
| 38 | + USERNAME: ${{ secrets.USERNAME }} |
| 39 | + SCRAPER_API_KEY: ${{ secrets.SCRAPER_API_KEY }} |
| 40 | + run: | |
| 41 | + coverage run -m unittest -v test_module.TestScholarlyWithProxy |
| 42 | + - name: Generate coverage report |
| 43 | + if: |
| 44 | + "matrix.os == 'macos-latest'" |
| 45 | + run: | |
| 46 | + curl --data-binary @.github/.codecov.yml https://codecov.io/validate | head -n 1 |
| 47 | + coverage xml |
| 48 | + - name: Upload code coverage |
| 49 | + uses: codecov/codecov-action@v2 |
| 50 | + with: |
| 51 | + directory: ./ |
| 52 | + fail_ci_if_error: false |
| 53 | + files: ./coverage.xml |
| 54 | + flags: unittests |
| 55 | + name: codecov-umbrella |
| 56 | + verbose: true |
| 57 | + - name: Check if unittests failed |
| 58 | + if: "steps.unittests.outcome == 'failure'" |
| 59 | + run: exit 1 |
0 commit comments