Skip to content

ci(check): fix caches #27

ci(check): fix caches

ci(check): fix caches #27

Workflow file for this run

name: CI/CD Checks
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ['3.9', '3.10', '3.11']
steps:
# Environment Setup
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# Tool Installation
- name: Load cached poetry installation
id: cached-poetry
uses: actions/cache@v3
with:
path: ~/.local/bin # the path depends on the OS
key: poetry-${{ matrix.python-version }}-1 # Increment cache key to clear cache
- name: Install Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
- name: Install Task
run: |
sudo sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
# Dependency Installation
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry/virtualenvs
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install the library
run: poetry install --no-interaction --only-root
# CI/CD Checks
- name: Run CI-CD-checks
run: poetry run task ci-cd-checks
- name: Upload coverage reports to Codecov
if: matrix.python-version == '3.11'
uses: codecov/codecov-action@v3
env:
fail_ci_if_error: true