[pre-commit.ci] pre-commit autoupdate #282
Workflow file for this run
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: [ main ] | |
pull_request: | |
schedule: | |
- cron: '0 1 * * 0' # run once a week on Sunday | |
# Allow to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
# [Python version, tox env] | |
- ["3.7", "py37"] | |
- ["3.8", "py38"] | |
- ["3.9", "py39"] | |
- ["3.10", "py310"] | |
- ["3.11", "py311"] | |
browser: | |
# - ff # unability to solve `API rate limit exceeded` problems | |
- chrome | |
# - edge # Edge version and driver version do not match | |
state: | |
- headless | |
# - head # disabled because it needs xvfb which is not so easy to set up on GHA | |
runs-on: ubuntu-latest | |
name: ${{ matrix.config[1] }}-${{ matrix.browser }}-${{ matrix.state }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.config[0] }} | |
- name: Pip cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('setup.*', 'tox.ini') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox | |
- name: Install dependencies (firefox) | |
if: matrix.browser == 'ff' | |
run: | | |
sudo apt-get update | |
sudo apt-get install firefox | |
- name: Install dependencies (edge) | |
if: matrix.browser == 'edge' | |
run: | | |
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg | |
sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/ | |
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-dev.list' | |
sudo rm microsoft.gpg | |
sudo apt update | |
sudo apt install microsoft-edge-stable | |
- name: Test | |
run: | | |
tox -f ${{ matrix.config[1] }}-${{ matrix.browser }}-${{ matrix.state }} | |
- name: Report to coveralls | |
run: | | |
pip install coverage coveralls | |
coverage combine | |
coveralls --service=github | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |