Make functions within partition visible for downstream usecases. #1
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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# Copied from www.github.com/google/flax | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Build | |
on: | |
push: | |
branches: | |
- main | |
- 'test_*' | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.9', '3.10', '3.11'] | |
steps: | |
- name: Cancel previous | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- name: Install native dependencies | |
run: | | |
sudo apt-get -y install pandoc | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: pip | |
cache-dependency-path: | | |
setup.py | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install . | |
pip install .[testing] | |
pip install pytest | |
pip install pytest-xdist | |
pip install pytest-cov | |
pip install netCDF4 | |
- name: Set Swap Space | |
uses: pierotofy/set-swap-space@master | |
with: | |
swap-size-gb: 10 | |
- name: Test with pytest and generate coverage report | |
run: | | |
JAX_ENABLE_X64=1 pytest --cov=jax_md --cov-report=xml --cov-report=term --cov-config=setup.cfg | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v1 | |
with: | |
file: ./coverage.xml | |
# The below step just reports the success or failure of tests as a "commit status". | |
# This is needed for copybara integration. | |
- name: Report success or failure as github status | |
if: always() | |
shell: bash | |
run: | | |
status="${{ job.status }}" | |
lowercase_status=$(echo $status | tr '[:upper:]' '[:lower:]') | |
curl -sS --request POST \ | |
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }} \ | |
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ | |
--header 'content-type: application/json' \ | |
--data '{ | |
"state": "'$lowercase_status'", | |
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", | |
"description": "'$status'", | |
"context": "github-actions/Build" | |
}' |