Skip to content

Commit 00b84bc

Browse files
committed
0 parents  commit 00b84bc

78 files changed

Lines changed: 24225 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copy to .env and fill in. Only the providers you actually use are required.
2+
3+
# --- LLM provider API keys (scientist / executor) ---
4+
OPENAI_API_KEY=
5+
ANTHROPIC_API_KEY=
6+
GEMINI_API_KEY=
7+
8+
# --- MLGym execution sandbox ---
9+
# Path to the Apptainer/Docker image MLGym runs candidate code in.
10+
MLGYM_APPTAINER_IMAGE=aigym/mlgym-agent:latest
11+
12+
# --- Optional ---
13+
# Where TTT rollout / reward logs are written (default: ./rollout_logs).
14+
AIR_ROLLOUT_LOG_DIR=
15+
# HuggingFace cache (model downloads).
16+
HF_HOME=
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: "Setup Python Environment"
2+
description: "Set up Python environment for the given Python version"
3+
4+
inputs:
5+
python-version:
6+
description: "Python version to use"
7+
required: true
8+
default: "3.12"
9+
uv-version:
10+
description: "uv version to use"
11+
required: true
12+
default: "0.9.21"
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: ${{ inputs.python-version }}
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v6
23+
with:
24+
version: ${{ inputs.uv-version }}
25+
enable-cache: 'true'
26+
cache-suffix: ${{ matrix.python-version }}
27+
28+
- name: Install Python dependencies
29+
run: uv sync --frozen
30+
shell: bash

.github/workflows/main.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Main
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, synchronize, reopened, ready_for_review]
9+
10+
jobs:
11+
quality:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out
15+
uses: actions/checkout@v4
16+
17+
- uses: actions/cache@v4
18+
with:
19+
path: ~/.cache/pre-commit
20+
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
21+
22+
- name: Set up the environment
23+
uses: ./.github/actions/setup-python-env
24+
25+
- name: Run checks
26+
run: make check
27+
28+
tests-and-type-check:
29+
runs-on: ubuntu-latest
30+
strategy:
31+
matrix:
32+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
33+
fail-fast: false
34+
defaults:
35+
run:
36+
shell: bash
37+
steps:
38+
- name: Check out
39+
uses: actions/checkout@v4
40+
41+
- name: Set up the environment
42+
uses: ./.github/actions/setup-python-env
43+
with:
44+
python-version: ${{ matrix.python-version }}
45+
46+
- name: Run tests
47+
run: uv run python -m pytest tests
48+
49+
- name: Check typing
50+
run: uv run ty check
51+
52+
53+
54+
check-docs:
55+
runs-on: ubuntu-latest
56+
steps:
57+
- name: Check out
58+
uses: actions/checkout@v4
59+
60+
- name: Set up the environment
61+
uses: ./.github/actions/setup-python-env
62+
63+
- name: Check if documentation can be built
64+
run: uv run mkdocs build -s
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: release-main
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
9+
set-version:
10+
runs-on: ubuntu-24.04
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Export tag
15+
id: vars
16+
run: echo tag=${GITHUB_REF#refs/*/} >> $GITHUB_OUTPUT
17+
if: ${{ github.event_name == 'release' }}
18+
19+
- name: Update project version
20+
run: |
21+
sed -i "s/^version = \".*\"/version = \"$RELEASE_VERSION\"/" pyproject.toml
22+
env:
23+
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
24+
if: ${{ github.event_name == 'release' }}
25+
26+
- name: Upload updated pyproject.toml
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: pyproject-toml
30+
path: pyproject.toml
31+
32+
publish:
33+
runs-on: ubuntu-latest
34+
needs: [set-version]
35+
steps:
36+
- name: Check out
37+
uses: actions/checkout@v4
38+
39+
- name: Set up the environment
40+
uses: ./.github/actions/setup-python-env
41+
42+
- name: Download updated pyproject.toml
43+
uses: actions/download-artifact@v4
44+
with:
45+
name: pyproject-toml
46+
47+
- name: Build package
48+
run: uv build
49+
50+
- name: Publish package
51+
run: uv publish
52+
env:
53+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
54+
55+
deploy-docs:
56+
needs: publish
57+
runs-on: ubuntu-latest
58+
steps:
59+
- name: Check out
60+
uses: actions/checkout@v4
61+
62+
- name: Set up the environment
63+
uses: ./.github/actions/setup-python-env
64+
65+
- name: Deploy documentation
66+
run: uv run mkdocs gh-deploy --force
67+

0 commit comments

Comments
 (0)