Skip to content

Commit

Permalink
add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
RexWzh committed Dec 20, 2024
1 parent 6a19b32 commit eedaeab
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 3 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Python Package

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

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.10"]
os: [ubuntu-latest]

steps:
- name: Install elan
run: |
set -o pipefail
curl -sSfL https://github.com/leanprover/elan/releases/download/v3.1.1/elan-x86_64-unknown-linux-gnu.tar.gz | tar xz
./elan-init -y --default-toolchain none
echo "$HOME/.elan/bin" >> $GITHUB_PATH
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Dependencies
run: |
pushd experiments/minif2f/MiniF2F/
lake exe cache get && lake build
popd
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "export PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
poetry build
poetry install
- name: Test with pytest
run: |
poetry run pytest -s tests/
7 changes: 4 additions & 3 deletions tests/test_minif2f.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,19 @@ def test_load_theorem(minif2f_server: Server, minif2f_test: DataFrame, minif2f_v
total_test = len(minif2f_test)
failed_valid_count = len(failed_valid)
failed_test_count = len(failed_test)

logger.info(f"""
Test Summary:
Valid theorems: {total_valid - failed_valid_count}/{total_valid} passed
Test theorems: {total_test - failed_test_count}/{total_test} passed
""")

# Detailed failure report
if failed_valid:
logger.error(f"Failed valid theorems: {failed_valid}")
if failed_test:
logger.error(f"Failed test theorems: {failed_test}")
# Final assertions
assert not failed_valid, f"{failed_valid_count} valid theorems failed"
assert not failed_test, f"{failed_test_count} test theorems failed"

@pytest.mark.advance
def test_advance_cases():
pass

0 comments on commit eedaeab

Please sign in to comment.