Support python 3.12 and misc #36
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 test only https://github.com/google/neural-tangents/pull/142 | |
# Copied from github.com/google/jax-md and github.com/google/jax | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: sketching | |
on: | |
push: | |
branches: | |
- '*/NT' | |
pull_request: | |
branches: | |
- main | |
jobs: | |
Sketching: | |
timeout-minutes: 240 | |
strategy: | |
matrix: | |
python-version: [3.11] | |
JAX_ENABLE_X64: [0, 1] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel previous | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/[email protected] | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/[email protected] | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install numpy jaxlib --upgrade | |
pip install -e . | |
pip install -e .[testing] | |
pip install pytest | |
pip install pytest-xdist | |
pip install pytest-cov | |
- name: Test with pytest and generate coverage report (Ubuntu) | |
run: | | |
JAX_ENABLE_X64=${{ matrix.JAX_ENABLE_X64 }} PYTHONHASHSEED=0 pytest experimental/tests/ -n auto --cov=experimental/ --cov-report=xml --cov-report=term | |
- name: Upload coverage to Codecov | |
uses: codecov/[email protected] | |
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/sketching" | |
}' |