Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up Github Actions #1

Merged
merged 1 commit into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Unittests

# Allow to trigger the workflow manually (e.g. when deps changes)
on: [push, workflow_dispatch]

jobs:
pytest-job:
runs-on: ubuntu-latest
timeout-minutes: 60

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

steps:
- uses: actions/checkout@v4

# Install deps
- uses: actions/setup-python@v5
with:
python-version: "3.10"

- run: git clone https://gitlab.com/qualikiz-group/qlknn-hyper.git
- run: echo "TORAX_QLKNN_MODEL_PATH=$PWD/qlknn-hyper" >> "$GITHUB_ENV"
- run: echo "TORAX_ERRORS_ENABLED=True" >> "$GITHUB_ENV"

- run: pip --version
- run: pip install -e .[dev]
# TODO(b/323504363): [dev] should install these
- run: pip install pytest pytest-xdist
- run: pip freeze

# Run tests (in parallel)
# TODO(b/323504363): tests should be discovered automatically
- name: Run core tests
run: pytest -vv -n auto torax/tests/{boundary_conditions,config,config_slice,geometry,interpolated_param,jax_utils,math_utils,opt,sim_time_dependence}.py

# TODO(b/323504363): these tests should also run under pytest
- name: "Run sim_custom_sources.py"
run: python torax/tests/sim_custom_sources.py
- name: "Run sim_no_compile.py"
run: TORAX_COMPILATION_ENABLED=False python torax/tests/sim_no_compile.py
- name: "Run sim.py"
run: python torax/tests/sim.py
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Unittests](https://github.com/google-deepmind/torax/actions/workflows/pytest.yml/badge.svg)](https://github.com/google-deepmind/torax/actions/workflows/pytest.yml)

# What is TORAX?

TORAX is a differentiable tokamak core transport simulator aimed for fast and accurate forward modelling, pulse-design, trajectory optimization, and controller design workflows. TORAX is written in Python-JAX, with the following motivations:
Expand Down