Skip to content
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
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI

on:
push:
branches: [master]
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install package
run: pip install -e ".[dev]"
- name: Run fast tests (units, VV equivalence, ideal-gas limit, energy conservation)
run: pytest tests/ --ignore=tests/test_vs_c_oracle.py -v

test-vs-oracle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install package
run: pip install -e ".[dev]"
- name: Build C oracle and run oracle-agreement tests
run: pytest tests/test_vs_c_oracle.py -v
72 changes: 72 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Publish to PyPI

# Builds the pure-Python wheel/sdist and publishes via PyPI Trusted Publishing
# (OIDC) -- no long-lived API token is stored in this repo. Publishing itself
# is authorized by whoever configures the "noblegasmd" trusted publisher on
# PyPI/TestPyPI to point at this repo + workflow; this workflow cannot publish
# until that's done.
#
# Trigger: push a tag matching v*.*.* (e.g. v0.1.0) to publish to PyPI, or run
# manually via workflow_dispatch with target=testpypi for a TestPyPI dry run.

on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
inputs:
target:
description: "Where to publish"
required: true
default: "testpypi"
type: choice
options:
- testpypi
- pypi

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Build sdist and wheel
run: |
python -m pip install --upgrade build
python -m build
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/

publish-testpypi:
needs: build
if: github.event_name == 'workflow_dispatch' && inputs.target == 'testpypi'
runs-on: ubuntu-latest
environment: testpypi
permissions:
id-token: write # required for OIDC trusted publishing
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

publish-pypi:
needs: build
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.target == 'pypi')
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write # required for OIDC trusted publishing
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
MD.exe
*.egg-info/
dist/
build/
__pycache__/
*.pyc
.pytest_cache/
.ipynb_checkpoints/
tests/oracle/MD_oracle.exe
tests/oracle/*_traj.xyz
tests/oracle/*_output.txt
tests/oracle/*_average.txt
.venv/
Loading
Loading