Skip to content

ci: [#2920] add arm64 build to docker pipeline #15091

ci: [#2920] add arm64 build to docker pipeline

ci: [#2920] add arm64 build to docker pipeline #15091

Workflow file for this run

name: code-quality
on:
push:
branches:
- main
- develop
tags:
- '*'
pull_request:
workflow_dispatch:
permissions: {}
jobs:
migrations:
name: Check for model changes not present in the migrations
runs-on: ubuntu-latest
permissions:
contents: read
services:
postgres:
image: postgres:12
env:
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
# Needed because the postgres container does not provide a healthcheck
options:
--health-cmd pg_isready --health-interval 10s --health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version-file: 'pyproject.toml'
- name: Install system packages
run: |
sudo apt-get update \
&& sudo apt-get install -y --no-install-recommends \
libgdal-dev \
gdal-bin \
libxml2-dev \
libxmlsec1-dev \
libxmlsec1-openssl
- name: Install dependencies
run: |
pip install uv
uv pip install -r requirements/dev.txt --system
- name: Run manage.py makemigrations --check --dry-run
run: |
src/manage.py makemigrations --check --dry-run
env:
DJANGO_SETTINGS_MODULE: open_inwoner.conf.dev
SECRET_KEY: dummy
DB_USER: postgres
DB_PASSWORD: ''
pre-commit:
name: Run pre-commit checks
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version-file: 'pyproject.toml'
- name: Install pre-commit
run: grep "^pre-commit" requirements/dev.txt | xargs pip install
- name: npm install
run: npm install
- name: Run pre-commit
run: pre-commit run --all-files
ruff-version-check:
name: Check ruff version consistency
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Check ruff versions match
run: |
# Extract ruff version from ci.txt
CI_VERSION=$(grep "^ruff" requirements/ci.txt | sed 's/.*==//')
# Extract ruff version from pre-commit config
PRECOMMIT_VERSION=$(grep -A1 "repo: https://github.com/astral-sh/ruff-pre-commit" .pre-commit-config.yaml | grep "rev:" | sed 's/.*v//')
echo "Ruff version in ci.txt: $CI_VERSION"
echo "Ruff version in pre-commit-config.yaml: $PRECOMMIT_VERSION"
if [ "$CI_VERSION" != "$PRECOMMIT_VERSION" ]; then
echo "❌ ERROR: Ruff versions do not match!"
echo "requirements/ci.txt has: $CI_VERSION"
echo ".pre-commit-config.yaml has: $PRECOMMIT_VERSION"
echo "Please update both files to use the same ruff version."
exit 1
else
echo "✅ SUCCESS: Ruff versions match ($CI_VERSION)"
fi
commit-message-check:
name: Validate commit messages
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version-file: 'pyproject.toml'
- name: Install commitizen
run: pip install commitizen==4.16.3
- name: Check commit messages
run: |
cz check --rev-range origin/${GITHUB_BASE_REF}..${{ github.event.pull_request.head.sha }}
zizmor:
name: GitHub Actions Security Analysis with zizmor 🌈
runs-on: ubuntu-latest
permissions:
security-events: write
contents: read
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Run zizmor 🌈
uses: zizmorcore/zizmor-action@70fb788f84895a7701f5643d103d587e460b5c99 # v0.6.3