Skip to content

Fixed whl installation in test CI #458

Fixed whl installation in test CI

Fixed whl installation in test CI #458

Workflow file for this run

name: CI
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install lint dependencies
run: |
pip install wheel setuptools
pip install black==22.3.0 isort==5.10.1 flake8==4.0.1
- name: Lint the code
run: sh shell/lint.sh
- name: Install dependencies
run: |
pip install tensorflow==2.8.0 tensorflow-addons
pip install "protobuf<=3.20" --force-reinstall
- name: Build wheel
run: python setup.py bdist_wheel
- name: Upload Python wheel
uses: actions/upload-artifact@v2
with:
name: Python wheel
path: ${{github.workspace}}/dist/gradient_accumulator-*.whl
if-no-files-found: error
test:
needs: build
runs-on: ${{ matrix.os }}
strategy:
# max-parallel: 10
matrix:
os: [windows-2019, ubuntu-20.04, macos-11]
python-version: ["3.8", "3.9", "3.10"]
tf-version: [2.8, 2.12]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install wheel setuptools flake8 pytest-cov
- name: Install tensorflow-datasets
run: |
if [[ ${{ matrix.tf-version }} == 2.12 ]]; then
pip install tensorflow-datasets --upgrade
else
pip install tensorflow==${{ matrix.tf-version }} "tensorflow-datasets<=4.8.2"
pip install "protobuf<=3.20" --force-reinstall
fi
shell: bash
- name: Download artifact
uses: actions/download-artifact@master
with:
name: "Python wheel"
- name: Install wheel
run: pip install --find-links=. gradient_accumulator-*
- name: Debug pip deps
run: pip list
- name: Test library accessibility
run: python -c "from gradient_accumulator import GradientAccumulateModel, GradientAccumulateOptimizer"
- name: Run tests
run: |
pytest -v tests/test_expected_result.py
pytest -v tests/test_mixed_precision.py
pytest -v tests/test_optimizer_invariance.py
pytest -v tests/test_multitask.py
pytest -v tests/test_adaptive_gradient_clipping.py
pytest -v tests/test_batch_norm.py
pytest -v tests/test_bn_convnd.py
pytest -v tests/test_mp_batch_norm.py
pytest -v tests/test_optimizer_distribute.py
pytest -v tests/test_model_distribute.py
tf-compability:
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
python-version: ["3.6"]
tf-version: [2.2.0, 2.3.0, 2.4.0, 2.5.0, 2.6.2]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install wheel setuptools flake8 pytest-cov
- name: Install tensorflow-datasets
run: |
pip install tensorflow==${{ matrix.tf-version }} "tensorflow-datasets<=4.8.2"
pip install "protobuf<=3.20" --force-reinstall
- name: Download artifact
uses: actions/download-artifact@master
with:
name: "Python wheel"
- name: Install wheel
run: pip install --find-links=. gradient_accumulator-*
- name: Debug pip deps
run: pip list
- name: Test library accessibility
run: python -c "from gradient_accumulator import GradientAccumulateModel, GradientAccumulateOptimizer"
- name: Run tests
run: pytest -v tests/test_model_expected_result.py