[pre-commit.ci] pre-commit autoupdate #136
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: | |
- master | |
# schedule: | |
# - cron: '0 18 * * *' # Run daily at 14:00 UTC | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ ! contains(github.ref, github.event.repository.default_branch) }} | |
jobs: | |
linting: | |
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'pytest-dev/pytest-selenium') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox | |
- name: Run tests | |
run: tox -e linting | |
test: | |
name: ubuntu-latest - ${{ matrix.tox-env || matrix.python-version }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | |
include: | |
- os: ubuntu-latest | |
python-version: pypy3.9 | |
tox-env: py3.9 | |
- os: ubuntu-latest | |
python-version: 3.11 | |
tox-env: devel | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install tox | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox | |
- name: Start browsers | |
run: docker/start | |
- name: Cache tox environments | |
uses: actions/cache@v3 | |
with: | |
path: .tox | |
key: tox-ubuntu-latest-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'tox.ini') }} | |
restore-keys: | | |
tox-ubuntu-latest-${{ matrix.python-version }}- | |
- name: Set tox variable | |
shell: bash | |
run: | | |
echo "python-version: ${{ matrix.python-version }}" | |
echo "tox-env: ${{ matrix.tox-env }}" | |
if [[ -n "${{ matrix.tox-env }}" ]]; then | |
echo "tox=${{ matrix.tox-env }}" >> "$GITHUB_ENV" | |
else | |
echo "tox=py${{ matrix.python-version }}" >> "$GITHUB_ENV" | |
fi | |
- name: Test | |
run: tox -e "${{ env.tox }}" | |
- name: Archive report.html | |
if: failure() | |
uses: actions/upload-artifact@v1 | |
with: | |
name: report.html.${{ matrix.os }}-${{ env.tox }}.zip | |
path: .tox/${{ env.tox }}/log/report.html | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox | |
- name: Run tests | |
run: tox -e docs |