From 4d1c722531ec6c6d6475f30f76adc02e131a6341 Mon Sep 17 00:00:00 2001 From: harryswift01 Date: Wed, 5 Nov 2025 08:40:12 +0000 Subject: [PATCH] ci: switch to mamba and add caching for faster CI builds: - Replaced conda with mamba in GitHub Actions for faster dependency resolution - Added caching of conda packages to reduce CI setup time - Simplified test execution to use pytest -v - Added pytest as a dependency in environment.yaml to avoid extra installs --- .github/workflows/python-app.yml | 21 ++++++++++++--------- environment.yaml | 1 + 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 8919c89..561f89e 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -28,27 +28,30 @@ jobs: - name: Checkout repo uses: actions/checkout@v5.0.0 - - name: Set up Miniconda + - name: Cache conda packages + uses: actions/cache@v4 + with: + path: ~/.conda/pkgs + key: ${{ runner.os }}-conda-${{ hashFiles('environment.yaml') }} + restore-keys: | + ${{ runner.os }}-conda- + + - name: Set up Mambaforge uses: conda-incubator/setup-miniconda@v3 with: + use-mamba: true python-version: ${{ matrix.python-version }} environment-file: environment.yaml activate-environment: prep auto-update-conda: true auto-activate-base: false - - name: Verify conda environment + - name: Verify environment shell: bash -l {0} run: | conda info conda list - - name: Install additional testing dependencies - shell: bash -l {0} - run: | - conda install -y pytest pytest-cov - - name: Run test suite shell: bash -l {0} - run: | - pytest --cov=prepmd --cov-report=term-missing --cov-append . + run: pytest -v diff --git a/environment.yaml b/environment.yaml index 8acdd9e..8142f5a 100644 --- a/environment.yaml +++ b/environment.yaml @@ -12,3 +12,4 @@ dependencies: - gemmi=0.7.1 - modeller=10.7 - biopython=1.85 + - pytest=8.4.2