Skip to content
Open
Show file tree
Hide file tree
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
33 changes: 33 additions & 0 deletions .github/actions/build-frontend/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build Parcel Assets
description: Build Parcel assets

runs:
using: composite
steps:
- uses: actions/setup-node@v5
shell: bash
with:
node-version-file: ".tool-versions"
cache: "npm"

- name: Install dependencies
shell: bash
run: npm ci

- uses: actions/cache@v4
name: Cache Parcel build
id: parcel-cache
with:
path: |
static/compiled
.parcel-cache
key: parcel-${{ runner.os }}-${{ hashFiles('package-lock.json') }}-${{ hashFiles('static/to_compile/**/*.css', 'static/to_compile/**/*.ts') }}
restore-keys: |
parcel-${{ runner.os }}-${{ hashFiles('package-lock.json') }}-${{ hashFiles('static/to_compile/**/*.css', 'static/to_compile/**/*.ts') }}
parcel-${{ runner.os }}-${{ hashFiles('package-lock.json') }}-
parcel-${{ runner.os }}-

- name: Build assets if cache missed
shell: bash
if: steps.parcel-cache.outputs.cache-hit != 'true'
run: npm run build
20 changes: 20 additions & 0 deletions .github/actions/setup-gdal/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Install GDAL
description: Install GDAL

runs:
using: "composite"
steps:
- name: Cache apt packages
id: apt-cache
uses: awalsh128/cache-apt-pkgs-action@9f7a885e33ff6f8166b600e3e74a981ec11b92c3
with:
packages: gdal-bin

# Install the package(s)
- name: Install packages
shell: bash
run: |
if [ "${{ steps.apt-cache.outputs.cache-hit }}" != "true" ]; then
sudo apt-get update -qq
fi
sudo apt-get install -y gdal-bin
26 changes: 26 additions & 0 deletions .github/actions/setup-python/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Install Python dependencies
description: Install Python dependencies

inputs:
flags:
description: "Flag to pass to uv sync command"
required: false

runs:
using: "composite"
steps:
- uses: actions/setup-python@v6
with:
cache: "pip"
- name: Install uv
uses: astral-sh/setup-uv@b75a909f75acd358c2196fb9a5f1299a9a8868a4
- uses: actions/cache@v4
name: Define a cache for the virtual environment based on the dependencies lock file
with:
path: ./.venv
key: venv-dev-airflow-${{ hashFiles('uv.lock') }}
- name: Install the project dependencies
run: uv sync $FLAGS
shell: bash
env:
FLAGS: ${{ inputs.flags }}
98 changes: 29 additions & 69 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
cache: "pip"
- name: Install uv
uses: astral-sh/setup-uv@b75a909f75acd358c2196fb9a5f1299a9a8868a4
- uses: actions/cache@v4
name: Define a cache for the virtual environment based on the dependencies lock file
with:
path: ./.venv
key: venv-dev-airflow-${{ hashFiles('uv.lock') }}
- name: Install the project dependencies
run: uv sync --only-dev
- uses: ./.github/actions/setup-python

- name: Install Terragrunt and OpenTofu
uses: gruntwork-io/terragrunt-action@95fc057922e3c3d4cc021a81a213f088f333ddef
with:
tg_version: '0.83.2'
tofu_version: '1.10.3'
tg_version: "0.83.2"
tofu_version: "1.10.3"
- name: Check code formatting
run: make check-format
- uses: astral-sh/ruff-action@57714a7c8a2e59f32539362ba31877a1957dded1 # v3.5.1
Expand All @@ -43,9 +33,8 @@ jobs:
with:
node-version-file: ".tool-versions"
cache: "npm"
- name: Build assets
run: |
npm ci
- name: Install dependencies
run: npm ci
- name: Check code formatting
run: npm run format:check

Expand All @@ -69,22 +58,10 @@ jobs:

steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
cache: "pip"
- name: Install GIS Packages
run: |
sudo apt-get update
sudo apt-get install gdal-bin
- name: Install uv
uses: astral-sh/setup-uv@b75a909f75acd358c2196fb9a5f1299a9a8868a4
- uses: actions/cache@v4
name: Define a cache for the virtual environment based on the dependencies lock file
- uses: ./.github/actions/setup-gdal
- uses: ./.github/actions/setup-python
with:
path: ./.venv
key: venv-dev-airflow-${{ hashFiles('uv.lock') }}
- name: Install the project dependencies
run: uv sync --group dev --group airflow
flags: --group dev --group airflow
- name: Run unit tests
run: make unit-test
- name: Run integration tests
Expand All @@ -100,22 +77,17 @@ jobs:
frontend_tests:
name: ✅ Frontend Tests
runs-on: ubuntu-latest
needs: [frontend_linter]
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version-file: ".tool-versions"
cache: "npm"
- name: Build assets
run: |
npm ci
npm run build
- uses: ./.github/actions/build-frontend
- name: Run tests
run: npm run test

e2e:
name: tests de bout-en-bout
runs-on: ubuntu-latest
needs: frontend_tests
if: ${{ github.ref_name == 'main' || (github.event_name == 'pull_request' && contains( github.event.pull_request.labels.*.name, 'frontend')) }}
services:
postgres:
Expand All @@ -133,41 +105,15 @@ jobs:
- 6543:5432
steps:
- uses: actions/checkout@v5

- name: Prepare environment
run: |
cp .env.template .env
echo BASE_URL=http://localhost:8000 >> .env
echo DEBUG=false >> .env

- uses: actions/setup-node@v5
with:
node-version-file: ".tool-versions"
cache: "npm"

- name: Build assets
run: |
npm ci
npm run build

- uses: actions/setup-python@v6
with:
cache: "pip"

- name: Install GIS Packages
run: |
sudo apt-get update
sudo apt-get install gdal-bin

- name: Install uv
uses: astral-sh/setup-uv@b75a909f75acd358c2196fb9a5f1299a9a8868a4
- uses: actions/cache@v4
name: Define a cache for the virtual environment based on the dependencies lock file
with:
path: ./.venv
key: venv-dev-${{ hashFiles('uv.lock') }}
- name: Install the project dependencies
run: uv sync --group dev
- uses: ./.github/actions/setup-gdal
- uses: ./.github/actions/build-frontend
- uses: ./.github/actions/setup-python

- name: Prepare django, migrate, collect static files...
run: |
Expand All @@ -187,7 +133,21 @@ jobs:
run: |
uv run python manage.py runserver &

- uses: actions/cache@v4
name: Cache Playwright browsers
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
~/.cache/playwright
key: playwright-browsers-${{ runner.os }}-${{ hashFiles('playwright.config.ts') }}
restore-keys: |
playwright-browsers-${{ runner.os }}-${{ hashFiles('playwright.config.ts') }}
playwright-browsers-${{ runner.os }}-
playwright-browsers-

- name: Install Playwright Browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: make init-playwright

- name: Run Playwright tests
Expand Down
35 changes: 13 additions & 22 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,19 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Check out the code
uses: actions/checkout@v5
- name: Check out the code
uses: actions/checkout@v5

- uses: actions/setup-python@v6
with:
cache: "pip"
- name: Install uv
uses: astral-sh/setup-uv@b75a909f75acd358c2196fb9a5f1299a9a8868a4
- uses: actions/cache@v4
name: Define a cache for the virtual environment based on the dependencies lock file
with:
path: ./.venv
key: venv-dev-docs-${{ hashFiles('uv.lock') }}
- name: Install the project dependencies
run: uv sync --group docs
- uses: .github/actions/setup-python
with:
flags: "--group docs"

- name: Build the documentation
run: |
uv run make build-docs
- name: Build the documentation
run: |
uv run make build-docs

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_build # Path to your built HTML files
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_build # Path to your built HTML files
Loading