Improved pip/conda/apt caching with docker build mount targets #48
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Main CI | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
workflow_call: | |
jobs: | |
test: | |
name: Test | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 20 | |
strategy: | |
max-parallel: 2 | |
fail-fast: true | |
matrix: | |
os: ["ubuntu-latest"] | |
python-version: ["3.7", "3.8", "3.9", "3.10"] | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
- name: Checkout git repo | |
uses: actions/checkout@master | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniforge-variant: Mambaforge | |
miniforge-version: latest | |
auto-update-conda: true | |
activate-environment: agi-pack-${{ matrix.os }}-${{ matrix.python-version }} | |
python-version: ${{ matrix.python-version }} | |
use-mamba: true | |
- name: Conda info | |
run: conda info | |
- name: Conda list | |
run: conda list | |
- uses: actions/cache@v3 | |
with: | |
path: /usr/share/miniconda3/envs/agi-pack-${{ matrix.os }}-${{ matrix.python-version }} | |
key: conda-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }} | |
id: cache | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pre-commit | |
key: pre-commit-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }} | |
- name: Install dependencies | |
run: make develop | |
if: steps.cache.outputs.cache-hit != 'true' | |
- name: Quality Check | |
run: make lint | |
- name: Test | |
run: make test |