Skip to content

Test Modules

Test Modules #472

Workflow file for this run

name: Test Modules
on:
- pull_request
- workflow_dispatch
jobs:
test-modules:
strategy:
matrix:
# os: [ubuntu-20.04, ubuntu-22.04, windows-latest, macos-13]
os: [ubuntu-20.04, ubuntu-22.04, macos-13]
python-version: ['3.8', '3.9', '3.10', '3.11']
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Check out private repository WoodOxen/trajectory_data_analysis
uses: actions/checkout@v4
with:
repository: WoodOxen/trajectory_data_analysis
token: ${{ secrets.TRAJ_DATA_SCP }}
path: tactics2d/data
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
# - name: Install development tools
# run: apt install -y python3-dev build-essential cmake
- name: Install dependencies
run: |
python -c "import os; print(os.name)"
python -m pip install --upgrade pip
pip install -r tests/requirements.txt
pip install -v .
- name: Pytest
run: |
mkdir ./tests/runtime
pytest tests --cov=tests --cov-report=xml
- name: Upload coverage reports to Codecov (Ubuntu)
uses: codecov/codecov-action@v4
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04'
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
test-modules-on-Ubuntu1804:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8']
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Check out private repository WoodOxen/trajectory_data_analysis
uses: actions/checkout@v4
with:
repository: WoodOxen/trajectory_data_analysis
token: ${{ secrets.TRAJ_DATA_SCP }}
path: tactics2d/data
- name: Make runtime directory
run: |
mkdir ./tests/runtime/
echo $GITHUB_WORKSPACE
- name: Run pytest in docker
run: |
docker pull ubuntu:18.04
docker run \
-v $GITHUB_WORKSPACE:/tactics2d \
ubuntu:18.04 \
/bin/bash -c 'apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository -y ppa:deadsnakes/ppa && \
apt-get update && \
apt-get update -y && \
apt-get install -y python${{ matrix.python-version }} python3-pip python${{ matrix.python-version }}-dev build-essential cmake && \
cd /tactics2d && \
python${{ matrix.python-version }} --version && \
python${{ matrix.python-version }} -m pip install --upgrade pip && \
if [ -f tests/requirements.txt ]; then pip install -r tests/requirements.txt; fi && \
pip install -v . && \
python${{ matrix.python-version }} -m pytest tests'