set up conda ci #197
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: Continuous Integration | |
on: [push] | |
jobs: | |
format: | |
name: Format check | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.8' | |
- name: Install black | |
run: cat tools/requirements_dev.txt | grep black | xargs pip install | |
- name: Format | |
run: tools/format.sh --checkonly | |
lint: | |
name: Lint check | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.8' | |
- name: Install pylint | |
run: cat tools/requirements_dev.txt | grep "pylint\|astroid" | xargs pip install | |
- name: Check | |
run: | | |
tools/lint.sh --version | |
tools/lint.sh | |
mypy: | |
name: mypy check | |
runs-on: macos-11 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.8' | |
- name: Install mypy | |
run: cat tools/requirements_dev.txt | grep "mypy\|torch" | xargs pip install | |
- name: Check | |
run: | | |
rm bluefoglite/common/tcp/message_pb2.py | |
tools/mypy.sh --version | |
tools/mypy.sh | |
ubuntu-unit-test: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
python-version: [3.8, 3.9] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
activate-environment: bluefoglite | |
- name: Install BlueFogLite | |
run: | | |
conda info | |
conda list | |
conda activate bluefoglite | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements.txt | |
python -m pip install . | |
cat tools/requirements_dev.txt | grep pytest | xargs pip install | |
- name: Unit Test | |
run: | | |
timeout 3m pytest -s -vv bluefoglite test | |
timeout 3m bflrun -np 4 pytest -s -vv test/allreduce_broadcast.py | |
macos-unit-test: | |
runs-on: macos-11 | |
strategy: | |
matrix: | |
python-version: [3.8, 3.9] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
activate-environment: bluefoglite | |
- name: Install brew coreutils | |
run: brew install coreutils # for timeout command | |
- name: Install BlueFogLite | |
run: | | |
conda info | |
conda list | |
conda activate bluefoglite | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements.txt | |
python -m pip install . | |
cat tools/requirements_dev.txt | grep pytest | xargs pip install | |
- name: Unit Test | |
run: | | |
timeout 3m pytest -s -vv bluefoglite test | |
timeout 3m bflrun -np 4 pytest -s -vv test/allreduce_broadcast.py |