speed up ci build and test

This commit is contained in:
Jakub Miazek 2023-03-27 21:20:26 +02:00
parent fbf2b339ad
commit 0e13625df0

View File

@ -1,16 +1,15 @@
name: Continuous Disaster... name: CI
on:
pull_request: on: pull_request
push:
branches:
- main
jobs: jobs:
test: ci:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix:
python-version: ["3.11"]
fail-fast: false fail-fast: false
matrix:
python-version: [ "3.11" ]
poetry-version: [ "1.4.0" ]
env: env:
PYTHONDONTWRITEBYTECODE: 1 PYTHONDONTWRITEBYTECODE: 1
@ -37,18 +36,13 @@ jobs:
- name: Create database schema - name: Create database schema
run: PGPASSWORD=secret psql -h 127.0.0.1 -d testdb -U app-user -c "CREATE SCHEMA shakespeare; CREATE SCHEMA happy_hog;" run: PGPASSWORD=secret psql -h 127.0.0.1 -d testdb -U app-user -c "CREATE SCHEMA shakespeare; CREATE SCHEMA happy_hog;"
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Install Poetry - name: Install Poetry
uses: snok/install-poetry@v1 uses: abatilo/actions-poetry@v2
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with: with:
path: .venv poetry-version: ${{ matrix.poetry-version }}
key: venv-${{ runner.os }}-3.11-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies - name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root run: poetry install --no-interaction --no-root