From 09a188cabee8d89a849ff92cbf32de7d0c717adf Mon Sep 17 00:00:00 2001 From: Gabriel Selzer Date: Tue, 31 Jan 2023 11:09:05 -0600 Subject: [PATCH] Use Mambaforge and cache downloads --- .github/workflows/build.yml | 14 ++++++++++++-- .pre-commit-config.yaml | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5f760d7e..3615d753 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -82,18 +82,28 @@ jobs: shell: bash -l {0} steps: - uses: actions/checkout@v2 + - name: Cache conda + uses: actions/cache@v2 + env: + # Increase this value to reset cache if etc/example-environment.yml has not changed + CACHE_NUMBER: 0 + with: + path: ~/conda_pkgs_dir + key: + ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ + hashFiles('etc/example-environment.yml') }} - uses: conda-incubator/setup-miniconda@v2 with: # Create env with dev packages auto-update-conda: true python-version: 3.9 + miniforge-variant: Mambaforge environment-file: dev-environment.yml - # Activate scyjava-dev environment + # Activate pyimagej-dev environment activate-environment: pyimagej-dev auto-activate-base: false # Use mamba for faster setup use-mamba: true - mamba-version: "*" - name: Test pyimagej run: | bin/test.sh tests --cov-report=xml --cov=. diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4a055111..79c12ac2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: - id: flake8 additional_dependencies: [flake8-typing-imports==1.7.0] - repo: https://github.com/PyCQA/isort - rev: 5.10.1 + rev: 5.12.0 hooks: - id: isort - repo: https://github.com/psf/black