Skip to content

Commit

Permalink
[tests] mirror updates from dev branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Schott committed Feb 14, 2021
1 parent b4d99eb commit 68caac3
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,17 @@ jobs:

runs-on: ${{ matrix.platform }}
steps:
- name: Checkout project

- name: Checkout merge commit
uses: actions/checkout@v2
if: github.event_name == 'pull_request_target'
with:
ref: 'refs/pull/${{ github.event.number }}/merge'

- name: Checkout head commit
uses: actions/checkout@v2
if: github.event_name != 'pull_request_target'

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
Expand All @@ -34,19 +40,20 @@ jobs:
python -m pip install --upgrade pip
python -m pip install --upgrade pytest
python -m pip install --upgrade pytest-cov
python -m pip install --upgrade pytest-rerunfailures
python -m pip install .
- name: Test with pytest
run: |
pytest --cov=maestral --cov-report=xml tests/offline
pytest --reruns 5 --cov=maestral --cov-report=xml tests/offline
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: pytest
env_vars: OS,PYTHON,TYPE
name: pytests
name: pytests -v
env:
OS: ${{ matrix.platform }}
PYTHON: ${{ matrix.python-version }}
Expand All @@ -71,11 +78,16 @@ jobs:

runs-on: ${{ matrix.platform }}
steps:
- name: Checkout project
- name: Checkout merge commit
uses: actions/checkout@v2
if: github.event_name == 'pull_request_target'
with:
ref: 'refs/pull/${{ github.event.number }}/merge'

- name: Checkout head commit
uses: actions/checkout@v2
if: github.event_name != 'pull_request_target'

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
Expand All @@ -86,6 +98,7 @@ jobs:
python -m pip install --upgrade pip
python -m pip install --upgrade pytest
python -m pip install --upgrade pytest-cov
python -m pip install --upgrade pytest-rerunfailures
python -m pip install .
- name: Get short-lived Dropbox token
Expand All @@ -99,11 +112,11 @@ jobs:
-d client_id=2jmbq42w7vof78h)
token=$(echo $auth_result | python -c "import sys, json; print(json.load(sys.stdin)['access_token'])")
echo "::add-mask::$token"
echo "DROPBOX_TOKEN=$token" >> $GITHUB_ENV
echo "DROPBOX_ACCESS_TOKEN=$token" >> $GITHUB_ENV
- name: Test with pytest
run: |
pytest --cov=maestral --cov-report=xml tests/linked
pytest -v --reruns 5 --cov=maestral --cov-report=xml tests/linked
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
Expand Down

0 comments on commit 68caac3

Please sign in to comment.