Add coix tutorials (#18) #98
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: Unittests & Auto-publish | |
# Allow to trigger the workflow manually (e.g. when deps changes) | |
on: [push, workflow_dispatch] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v3 | |
# Install deps | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- run: sudo apt install -y pandoc gsfonts | |
- run: pip --version | |
- run: pip install -e .[dev,doc,oryx] | |
- run: pip freeze | |
- name: Run lint | |
run: make lint | |
- name: Build documentation | |
run: make docs | |
pytest-job: | |
needs: lint | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
steps: | |
- uses: actions/checkout@v3 | |
# Install deps | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
# Uncomment to cache of pip dependencies (if tests too slow) | |
# cache: pip | |
# cache-dependency-path: '**/pyproject.toml' | |
- run: pip install -e .[dev,oryx] | |
# Run tests (in parallel) | |
- name: Run core tests | |
run: pytest -vv -n auto | |
# Run custom prng tests | |
- name: Run custom prng tests | |
run: JAX_ENABLE_CUSTOM_PRNG=1 pytest -vv -n auto | |
# Auto-publish when version is increased | |
publish-job: | |
# Only try to publish if: | |
# * Repo is self (prevents running from forks) | |
# * Branch is `main` | |
if: | | |
github.repository == 'jax-ml/coix' | |
&& github.ref == 'refs/heads/main' | |
needs: pytest-job # Only publish after tests are successful | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
timeout-minutes: 30 | |
steps: | |
# Publish the package (if local `__version__` > pip version) | |
- uses: etils-actions/pypi-auto-publish@v1 | |
with: | |
pypi-token: ${{ secrets.PYPI_API_TOKEN }} | |
gh-token: ${{ secrets.GITHUB_TOKEN }} | |
parse-changelog: true |