feat: support online eval during score #530
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, pull_request] | |
env: | |
CI: true | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 20 | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
python-version: [3.6, 3.7, 3.8, 3.9] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache conda | |
uses: actions/cache@v1 | |
env: | |
# Increase this value to reset cache | |
CACHE_NUMBER: 0 | |
with: | |
path: ~/conda_pkgs_dir | |
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }} | |
- name: Install miniconda and python version ${{ matrix.python-version }} | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
channels: conda-forge | |
channel-priority: strict | |
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! | |
- name: Install Emmental | |
shell: bash -l {0} | |
run: | | |
make dev | |
pip install -q pytest-cov | |
- name: Run preliminary checks | |
shell: bash -l {0} | |
run: | | |
isort --version | |
black --version | |
flake8 --version | |
mypy --version | |
make check | |
make docs | |
- name: Test with pytest | |
shell: bash -l {0} | |
run: | | |
pytest --cov=./ --cov-report=xml | |
- name: Upload to codecov.io | |
uses: codecov/codecov-action@v1 | |
with: | |
file: ./coverage.xml | |
flags: unittests | |
name: codecov-umbrella | |
fail_ci_if_error: true | |
build-and-publish: | |
name: Build and Publish Emmental to PyPI | |
runs-on: ubuntu-latest | |
needs: test | |
strategy: | |
matrix: | |
python-version: [3.7] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Build Emmental | |
run: | | |
pip install -U setuptools wheel pip | |
python setup.py sdist bdist_wheel | |
# - name: Publish distribution to Test PyPi | |
# uses: pypa/gh-action-pypi-publish@master | |
# with: | |
# password: ${{ secrets.test_pypi_password }} | |
# repository_url: https://test.pypi.org/legacy/ | |
- name: Publish distribution 📦 to PyPI | |
if: startsWith(github.event.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
password: ${{ secrets.pypi_password }} |