Skip to content

Commit

Permalink
adding matrix to the ci
Browse files Browse the repository at this point in the history
  • Loading branch information
rdyro committed Dec 2, 2024
1 parent f198118 commit 07dd079
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,26 @@ concurrency:

jobs:
lint_and_typecheck:
strategy:
matrix:
python-version: ["3.11", "3.12"]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: ${{ matrix.python-version }}
- run: |
python3 -m pip install -U ruff
ruff format --diff torch2jax
ruff check torch2jax
pytest:
strategy:
matrix:
python-version: ["3.11", "3.12"]
jax-version: ["0.4.30", "0.4.35", "latest"]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
Expand All @@ -41,10 +48,10 @@ jobs:
run: |
sudo DEBIAN_FRONTEND=noninteractive apt update -y
sudo DEBIAN_FRONTEND=noninteractive apt install -y ninja-build coreutils
- name: Set up Python 3.11
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: ${{ matrix.python-version }}
- name: Get uv cache dir
id: uv-cache
run: |
Expand All @@ -61,7 +68,12 @@ jobs:
[[ ! -d ~/.venv ]] && uv venv --seed ~/.venv
source ~/.venv/bin/activate
uv pip install pytest && pip install pytest
uv pip install -U jax torch
if [[ ${{ matrix.jax-version }} == "latest" ]]; then
uv pip install -U jax
else
uv pip install jax==${{ matrix.jax-version }}
fi
uv pip install -U torch
uv pip install -U .
- name: Get extension path
id: cpp-extension-cache
Expand Down
4 changes: 2 additions & 2 deletions scripts/make_aliased_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@
# rewrite the pyproject.toml file
pyproject_toml = Path(root_path / "pyproject.toml").read_text()
new_pyproject_toml = re.sub(
f"name\s*=\s*\"{current_config['project']['name']}\"",
f"name\\s*=\\s*\"{current_config['project']['name']}\"",
f'name = "{new_name}"',
pyproject_toml,
)
new_pyproject_toml = re.sub(
f"{current_config['project']['name']}\s*=", f"{new_name} = ", new_pyproject_toml
f"{current_config['project']['name']}\\s*=", f"{new_name} = ", new_pyproject_toml
)
Path(new_package_path / "pyproject.toml").write_text(new_pyproject_toml)

Expand Down

0 comments on commit 07dd079

Please sign in to comment.