|
| 1 | +on: [push, pull_request] |
| 2 | + |
| 3 | +jobs: |
| 4 | + test: |
| 5 | + name: test |
| 6 | + runs-on: ${{ matrix.os }} |
| 7 | + strategy: |
| 8 | + fail-fast: false |
| 9 | + matrix: |
| 10 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 11 | + browser: [Chrome, Firefox, Safari, Edge] |
| 12 | + exclude: |
| 13 | + - os: macos-latest |
| 14 | + browser: Edge |
| 15 | + - os: windows-latest |
| 16 | + browser: Safari |
| 17 | + - os: ubuntu-latest |
| 18 | + browser: Safari |
| 19 | + - os: ubuntu-latest |
| 20 | + browser: Edge |
| 21 | + |
| 22 | + steps: |
| 23 | + - name: Checkout code |
| 24 | + uses: actions/checkout@v2 |
| 25 | + - uses: actions/setup-python@v2 |
| 26 | + with: |
| 27 | + python-version: '3.9' |
| 28 | + |
| 29 | + - name: enable-safaridriver |
| 30 | + if: ${{ matrix.os == 'macos-latest' }} |
| 31 | + run: sudo safaridriver --enable |
| 32 | + |
| 33 | + - name: install-deps |
| 34 | + run: | |
| 35 | + python -m pip install -r ./requirements.txt |
| 36 | + python -m pip install coveralls pytest mock |
| 37 | +
|
| 38 | + - name: run unittests |
| 39 | + env: |
| 40 | + BEHAVE_WEBDRIVER: ${{ matrix.browser }} |
| 41 | + BEHAVE_WEBDRIVER_HEADLESS: "1" |
| 42 | + ENV_BASE_URL: "http://127.0.0.1:8000/" |
| 43 | + run: | |
| 44 | + coverage run -m pytest tests/unittests |
| 45 | +
|
| 46 | + - name: start-test-server |
| 47 | + shell: bash |
| 48 | + run: | |
| 49 | + cd tests/demo-app |
| 50 | + python ./runserver.py > /dev/null 2>&1 & |
| 51 | + cd ../.. |
| 52 | +
|
| 53 | + - name: regedit |
| 54 | + if: ${{ matrix.os == 'windows-latest' }} |
| 55 | + shell: cmd |
| 56 | + run: | |
| 57 | + regedit /s .\ci\bfcache.reg |
| 58 | +
|
| 59 | + - name: run-behave-tests |
| 60 | + env: |
| 61 | + BEHAVE_WEBDRIVER: ${{ matrix.browser }} |
| 62 | + BEHAVE_WEBDRIVER_HEADLESS: "1" |
| 63 | + ENV_BASE_URL: "http://127.0.0.1:8000/" |
| 64 | + run: | |
| 65 | + coverage run -a -m behave tests/features |
| 66 | +
|
| 67 | + - name: coveralls |
| 68 | + if: ${{ success() }} |
| 69 | + env: |
| 70 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 71 | + run: coveralls --service=github |
0 commit comments