From eedaeabdf50ca6c8f6ad9bc17604c5e7dc78603d Mon Sep 17 00:00:00 2001 From: rexwzh <1073853456@qq.com> Date: Sat, 21 Dec 2024 01:28:09 +0800 Subject: [PATCH] add github action --- .github/workflows/test.yaml | 60 +++++++++++++++++++++++++++++++++++++ tests/test_minif2f.py | 7 +++-- 2 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..aa15aae --- /dev/null +++ b/.github/workflows/test.yaml @@ -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/ \ No newline at end of file diff --git a/tests/test_minif2f.py b/tests/test_minif2f.py index 89d87ac..db6d503 100644 --- a/tests/test_minif2f.py +++ b/tests/test_minif2f.py @@ -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 \ No newline at end of file