Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 68 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@ on:
pull_request:
branches: [main]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
checks:
static-checks:
runs-on: ubuntu-latest

steps:
Expand All @@ -21,6 +28,12 @@ jobs:
cache: pip
cache-dependency-path: infra/requirements/dev.txt

- name: Cache pre-commit environments
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-py3.13-${{ hashFiles('.pre-commit-config.yaml') }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -35,6 +48,31 @@ jobs:
bot \
tests

- name: Run pre-commit
run: make lint

migration-heads:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
cache: pip
cache-dependency-path: infra/requirements/dev.txt

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r infra/requirements/dev.txt

- name: Create CI env file
run: cp .env.example .env

- name: Check migration HEADs
run: |
export PYTHONPATH="$PWD"
Expand All @@ -46,8 +84,27 @@ jobs:
exit 1
fi

- name: Run pre-commit
run: make lint
tests:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
cache: pip
cache-dependency-path: infra/requirements/dev.txt

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r infra/requirements/dev.txt

- name: Create CI env file
run: cp .env.example .env

- name: Run tests with coverage
run: make test-cov
Expand All @@ -59,5 +116,13 @@ jobs:
format: cobertura
file: coverage.xml

docker-build:
runs-on: ubuntu-latest
needs: [static-checks, migration-heads, tests]

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Build Docker image
run: docker build -f infra/docker/Dockerfile -t engflowbot:ci .
Loading