Skip to content

Commit

Permalink
github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ASEM000 committed Sep 26, 2023
1 parent c6341e9 commit 4652ec5
Show file tree
Hide file tree
Showing 6 changed files with 212 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: docs

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
test-ubuntu:
name: "docs on ${{ matrix.python-version }} on ${{ matrix.os }}"
runs-on: "${{ matrix.os }}"
strategy:
matrix:
python-version: ["3.10"]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt install -y pandoc
python -m pip install --upgrade pip
pip install .
pip install -r docs/requirements.txt
- name: Test doctests
run: |
cd docs
make doctest
- name: Test docs to HTML
run: |
cd docs
make html
25 changes: 25 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: pypi
on:
release:
types: [published]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
pip install twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m build
python -m twine upload dist/*
38 changes: 38 additions & 0 deletions .github/workflows/test_default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: default

on:
- push
- pull_request

jobs:
test:
runs-on: ${{ matrix.os }}
env:
PYTREECLASS_BACKEND: numpy
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install optree numpy
python -m pip install typing-extensions
python -m pip install pytest pytest-benchmark wheel coverage
- name: Pytest Check
run: |
export PYTREECLASS_BACKEND=default
python -m pip install .
coverage run -m pytest tests
- name: Codecov
uses: codecov/[email protected]
35 changes: 35 additions & 0 deletions .github/workflows/test_jax.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: jax backend

on:
- push
- pull_request

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install jaxlib jax
python -m pip install typing-extensions
python -m pip install pytest pytest-benchmark wheel coverage
- name: Pytest Check
run: |
export PYTREECLASS_BACKEND=jax
python -m pip install .
coverage run -m pytest tests
- name: Codecov
uses: codecov/[email protected]
38 changes: 38 additions & 0 deletions .github/workflows/test_numpy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: numpy backend

on:
- push
- pull_request

jobs:
test:
runs-on: ${{ matrix.os }}
env:
PYTREECLASS_BACKEND: numpy
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install optree numpy
python -m pip install typing-extensions
python -m pip install pytest pytest-benchmark wheel coverage
- name: Pytest Check
run: |
export PYTREECLASS_BACKEND=numpy
python -m pip install .
coverage run -m pytest tests
- name: Codecov
uses: codecov/[email protected]
38 changes: 38 additions & 0 deletions .github/workflows/test_torch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: torch backend

on:
- push
- pull_request

jobs:
test:
runs-on: ${{ matrix.os }}
env:
PYTREECLASS_BACKEND: numpy
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install optree torch numpy
python -m pip install typing-extensions
python -m pip install pytest pytest-benchmark wheel coverage
- name: Pytest Check
run: |
export PYTREECLASS_BACKEND=torch
python -m pip install .
coverage run -m pytest tests
- name: Codecov
uses: codecov/[email protected]

0 comments on commit 4652ec5

Please sign in to comment.