|
| 1 | +name: test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + tags-ignore: |
| 8 | + - v* |
| 9 | + pull_request: |
| 10 | + workflow_call: |
| 11 | + |
| 12 | +env: |
| 13 | + PYTEST_ADDOPTS: "-m 'not (edge or safari)'" |
| 14 | + |
| 15 | +jobs: |
| 16 | + test: |
| 17 | + runs-on: ${{ matrix.os }} |
| 18 | + strategy: |
| 19 | + fail-fast: false |
| 20 | + matrix: |
| 21 | + python: ["3.6", "3.7", "3.8", "3.9", "3.10", "pypy-3.8"] |
| 22 | + os: [ubuntu-latest, windows-latest] |
| 23 | + include: |
| 24 | + - python: "3.6" |
| 25 | + tox_env: "py36" |
| 26 | + - python: "3.7" |
| 27 | + tox_env: "py37" |
| 28 | + - python: "3.8" |
| 29 | + tox_env: "py38" |
| 30 | + - python: "3.9" |
| 31 | + tox_env: "py39" |
| 32 | + - python: "3.10" |
| 33 | + tox_env: "py310" |
| 34 | + - python: "pypy-3.8" |
| 35 | + tox_env: "pypy3" |
| 36 | + steps: |
| 37 | + - uses: actions/checkout@v3 |
| 38 | + |
| 39 | + - name: Set up Python |
| 40 | + uses: actions/setup-python@v3 |
| 41 | + with: |
| 42 | + python-version: ${{ matrix.python }} |
| 43 | + |
| 44 | + - name: Install tox |
| 45 | + run: | |
| 46 | + python -m pip install --upgrade pip |
| 47 | + pip install tox |
| 48 | +
|
| 49 | + - name: Setup Firefox |
| 50 | + if: matrix.os == 'ubuntu-latest' |
| 51 | + uses: browser-actions/setup-firefox@latest |
| 52 | + with: |
| 53 | + firefox-version: latest |
| 54 | + |
| 55 | + - name: Setup Geckodriver |
| 56 | + if: matrix.os == 'ubuntu-latest' |
| 57 | + uses: browser-actions/setup-geckodriver@latest |
| 58 | + |
| 59 | + - name: Setup Chrome |
| 60 | + uses: browser-actions/setup-chrome@latest |
| 61 | + with: |
| 62 | + chrome-version: stable |
| 63 | + |
| 64 | + - name: Setup Chromedriver |
| 65 | + uses: nanasess/setup-chromedriver@master |
| 66 | + |
| 67 | + - name: Cache tox environments |
| 68 | + if: matrix.os != 'windows-latest' && matrix.python != '3.6' |
| 69 | + uses: actions/cache@v3 |
| 70 | + with: |
| 71 | + path: .tox |
| 72 | + key: tox-${{ matrix.os }}-${{ matrix.python }}-${{ hashFiles('pyproject.toml', 'poetry.lock') }} |
| 73 | + |
| 74 | + - name: Test |
| 75 | + if: matrix.os == 'ubuntu-latest' |
| 76 | + run: tox -e ${{ matrix.tox_env }} |
| 77 | + |
| 78 | + - name: Test (skip firefox on windows) |
| 79 | + if: matrix.os == 'windows-latest' |
| 80 | + env: |
| 81 | + PYTEST_ADDOPTS: "-m 'not (edge or safari or firefox)'" |
| 82 | + run: tox -e ${{ matrix.tox_env }} |
| 83 | + |
| 84 | + docs: |
| 85 | + runs-on: ubuntu-latest |
| 86 | + steps: |
| 87 | + - uses: actions/checkout@v3 |
| 88 | + |
| 89 | + - name: Set up Python |
| 90 | + uses: actions/setup-python@v3 |
| 91 | + with: |
| 92 | + python-version: 3.9 |
| 93 | + |
| 94 | + - name: Install dependencies |
| 95 | + run: | |
| 96 | + python -m pip install --upgrade pip |
| 97 | + pip install tox |
| 98 | +
|
| 99 | + - name: Run tests |
| 100 | + run: "tox -e docs" |
0 commit comments