add multicpu test #68
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
permissions: | |
contents: write | |
jobs: | |
test: | |
name: Python ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
version: | |
- "3.12" | |
os: | |
- ubuntu-latest | |
arch: | |
- x86 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install coverage | |
pip install pytest pytest-cov | |
pip install -r requirements.txt | |
- name: Run tests | |
run: | | |
export RANK=0 | |
export LOCAL_RANK=0 | |
export WORLD_SIZE=1 | |
export MASTER_ADDR=localhost | |
export MASTER_PORT=12345 | |
export PYTHONPATH=MCintegration | |
pytest --cov --cov-report=xml --ignore=examples | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
docs: | |
name: Documentation | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install sphinx | |
pip install -r requirements.txt | |
- name: Build documentation | |
run: | | |
cd docs | |
sphinx-apidoc -o source ../MCintegration ../MCintegration/*_test.py | |
python ../clean_MCintegration_rst.py | |
make html | |
python ../clean_html_sidebar.py | |
- name: Deploy documentation to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: docs/build/html |