Skip to content

Update Trunk CLI version, plugin refs, and linters #118

Update Trunk CLI version, plugin refs, and linters

Update Trunk CLI version, plugin refs, and linters #118

Workflow file for this run

# This is a basic GitHub Actions workflow for running CI tests on a Django
# project. It runs on Ubuntu 22.04 with 4 parallel jobs, caches system
# packages and Python dependencies, and checks out the repository with a
# fetch depth of 1. The build job sets the Python version to 3.11 and runs
# the tests using the specified matrix. It is triggered on push or pull
# request events on the main branch, as well as manually using the
# workflow_dispatch event. For more information, see
# https://docs.github.com/en/actions/guides/building-and-testing-python#building-and-testing-python-with-multiple-versions
name: Django CI (basic)
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04
services:
postgres:
image: postgres:13
env:
POSTGRES_USER: user
POSTGRES_PASSWORD: pass
POSTGRES_DB: afbrequests
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DB_NAME: afbrequests
DB_USER: user
DB_PASSWORD: pass
DB_ENGINE: django.db.backends.postgresql
defaults:
run:
working-directory: ./apps/api
strategy:
max-parallel: 4
matrix:
python-version: ["3.11"]
steps:
- name: Cache system packages
uses: actions/[email protected]
with:
path: /var/cache/apt/archives
key: ${{ runner.os }}-apt-${{ hashFiles('apt.txt') }}
restore-keys: ${{ runner.os }}-apt-
- name: Cache python dependencies
uses: actions/[email protected]
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: Install Pillow
run: python -m pip install Pillow
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Tests
run: |
python manage.py test afbcore.tests