Skip to content

RF: Rename rnd to rng and use instead of seed if applicable. #156

RF: Rename rnd to rng and use instead of seed if applicable.

RF: Rename rnd to rng and use instead of seed if applicable. #156

Workflow file for this run

name: Run tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
pytest:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest, macos-13]
python-version: ['3.9', '3.10', '3.11', '3.12']
exclude:
- os: macos-latest
python-version: '3.9'
- os: macos-13
python-version: '3.10'
- os: macos-13
python-version: '3.11'
- os: macos-13
python-version: '3.12'
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
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 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: pytest
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true
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", "3.12"]
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
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
contrib:
# 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.12"]
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
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: Test with pytest
run: |
python -m pytest -v -s contrib/
timeout-minutes: 3
- name: Run ci_engine session
run: |
cd contrib
python ci_engine.py -n 5
timeout-minutes: 5