Skip to content

Systematic error testing #153

Systematic error testing

Systematic error testing #153

Workflow file for this run

name: Test Pelita and build docs to gh-pages
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.9, "3.10", "3.11"]
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest-cov
python -m pip install pytest-timestamper # this plugin adds timestamps to the output
python -m pip install -e .
python -c "import zmq; print('Using pyzmq {} and zmq {}.'.format(zmq.pyzmq_version(), zmq.zmq_version()))"
- name: Test with pytest
run: |
python -m pytest -v -s --cov=./pelita/ test/
timeout-minutes: 8
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
- name: Upload coverage data to coveralls.io
uses: AndreMiras/coveralls-python-action@develop
if: runner.os == 'Linux' # Only works on Linux
with:
github-token: ${{ secrets.github_token }}
flag-name: run-${{ matrix.os }}-py-${{ matrix.python-version }}
parallel: true
- name: Run Pelita CLI as a module
run: |
python -m pelita.scripts.pelita_main --null
- name: Run Pelita CLI as a script
run: |
pelita --null --rounds 100 --size small
- name: Test Pelita template repo
run: |
# We must clone pelita_template to a location outside of the pelita repo
# Otherwise pelita’s own setup.cfg will be used for test configuration
cd ..
git clone https://github.com/ASPP/pelita_template
cd pelita_template
python -m pytest -v -s .
coveralls:
name: Indicate completion to coveralls.io
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true
test-tournament:
# The tournament does not need to run everywhere.
# Only test on the latest ubuntu/macos for recent versions of Python.
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.10", "3.11"]
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .
python -c "import zmq; print('Using pyzmq {} and zmq {}.'.format(zmq.pyzmq_version(), zmq.zmq_version()))"
- name: Run Pelita tournament
run: |
pelita-tournament --non-interactive --viewer null
timeout-minutes: 10
deploy_docs:
needs: [test, test-tournament]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # fetch all history and tags (needed for git describe)
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install sphinx and prepare repo
run: |
python -m pip install --upgrade pip
python -m pip install sphinx
pip install -e .
- name: Build docs
run: |
. ./build-docs.sh
- name: Deploy to gh-pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: doc/build/html/
commit_message: ${{ github.event.head_commit.message }}