Skip to content

Commit 07f9c3a

Browse files
committed
Merge branch 'master' into feat/valhalla
2 parents f30bdf4 + ce72cc6 commit 07f9c3a

263 files changed

Lines changed: 13163 additions & 1047 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ RDC_WEBHOOK_SECRET=
152152
###> feature flags ###
153153
RFM_ENABLED=0
154154
RDC_ENABLED=0
155+
ZELTY_ENABLED=0
155156
###< feature flags ###
156157

157158
###> acseo/typesense-bundle ###

.github/actions/run-coopcycle-web/action.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
name: Run CoopCycle Web
22

3+
inputs:
4+
wait-for-webpack:
5+
description: >
6+
Wait for the first webpack build to finish. Only needed by jobs that render
7+
pages including the Encore entrypoints (the e2e suite). The API test suites do
8+
not, and waiting costs ~2.5 minutes.
9+
required: false
10+
default: 'true'
11+
312
runs:
413
using: "composite"
514
steps:
@@ -10,13 +19,26 @@ runs:
1019
- name: Pull Docker images
1120
shell: bash
1221
run: docker compose pull --ignore-pull-failures
22+
# Downloading the extract and running extract/partition/customize takes ~4 minutes,
23+
# and the result only changes when the OSRM version or the profile changes — both of
24+
# which are pinned by docker/osrm/Dockerfile, so it is part of the cache key.
25+
- name: Restore OSRM data
26+
id: osrm-cache
27+
uses: actions/cache@v4
28+
with:
29+
path: var/osrm
30+
key: osrm-paris-france-${{ hashFiles('docker/osrm/Dockerfile') }}
1331
- name: Prepare OSRM data
32+
if: steps.osrm-cache.outputs.cache-hit != 'true'
1433
shell: bash
1534
run: |
1635
docker compose run -T --rm osrm wget --no-check-certificate https://coopcycle-assets.sfo2.digitaloceanspaces.com/osm/paris-france.osm.pbf -O /data/data.osm.pbf
1736
docker compose run -T --rm osrm osrm-extract -p /opt/bicycle.lua /data/data.osm.pbf
1837
docker compose run -T --rm osrm osrm-partition /data/data.osrm
1938
docker compose run -T --rm osrm osrm-customize /data/data.osrm
39+
# osrm-routed only reads data.osrm* (see docker/osrm/start.sh), so the ~180 MB
40+
# source extract does not need to be carried around in the cache.
41+
docker compose run -T --rm osrm rm -f /data/data.osm.pbf
2042
- name: Start Docker containers
2143
shell: bash
2244
# specify -f docker-compose.yml explicitly, because we don't want to load docker-compose.override.yml
@@ -25,6 +47,7 @@ runs:
2547
shell: bash
2648
run: until docker inspect --format='{{ .State.Health.Status }}' $(docker compose ps -q php) | grep -wq healthy; do sleep 5; done
2749
- name: Wait webpack
50+
if: inputs.wait-for-webpack == 'true'
2851
shell: bash
2952
run: until [ -f "web/build/entrypoints.json" ]; do sleep 5; done
3053
- name: Create database

.github/actions/upload-symfony-logs/action.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: Upload Symfony logs
22

3+
inputs:
4+
name:
5+
description: 'Name of the artifact. Must be unique inside a workflow run, so it has to include the shard when the job runs in a matrix.'
6+
required: false
7+
default: 'symfony-logs'
8+
39
runs:
410
using: "composite"
511
steps:
@@ -9,5 +15,5 @@ runs:
915
- name: Upload Symfony logs
1016
uses: actions/upload-artifact@v4
1117
with:
12-
name: symfony-logs
18+
name: ${{ inputs.name }}
1319
path: symfony_logs.log

.github/workflows/lint_js.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Lint JS
22
on: push
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
36
env:
47
APP_ENV: test
58
NODE_ENV: test

.github/workflows/lint_php.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Lint PHP
22
on: push
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
36
env:
47
APP_ENV: test
58
jobs:

.github/workflows/test_behat.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: API Tests
22
on: push
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
36
env:
47
APP_ENV: test
58
NODE_ENV: test
@@ -27,6 +30,10 @@ jobs:
2730
- uses: actions/checkout@v4
2831
- name: Run CoopCycle Web
2932
uses: ./.github/actions/run-coopcycle-web
33+
with:
34+
# The Behat suite only drives the API, it never renders a page
35+
# including the Encore entrypoints
36+
wait-for-webpack: 'false'
3037
timeout-minutes: 10
3138
- name: Run Behat
3239
run: make behat ARGS="-f progress"

.github/workflows/test_component.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Component Tests
22
on: push
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
36
env:
47
APP_ENV: test
58
NODE_ENV: test

.github/workflows/test_e2e.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: E2E tests
22
on: push
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
36
env:
47
APP_ENV: test
58
NODE_ENV: test
@@ -11,7 +14,10 @@ jobs:
1114
matrix:
1215
php_version:
1316
- '8.3'
14-
- '8.4'
17+
# The specs are split round-robin over the sorted spec list, see the
18+
# "Select the specs for this shard" step. To split the suite further, add a
19+
# shard here *and* bump SHARD_TOTAL below to match.
20+
shard: [1, 2, 3, 4]
1521
fail-fast: false
1622
env:
1723
GEOCODE_EARTH_API_KEY: ${{ secrets.GEOCODE_EARTH_API_KEY }}
@@ -22,12 +28,28 @@ jobs:
2228
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
2329
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
2430
PHP_VERSION: ${{ matrix.php_version }}
31+
# Number of entries in matrix.shard. Deliberately not strategy.job-total, which
32+
# would also count any other matrix dimension (a second PHP version, say) and
33+
# would then silently make each shard run only a fraction of its specs.
34+
SHARD_TOTAL: 4
2535
steps:
2636
- name: Set timezone
2737
uses: szenius/set-timezone@v2.0
2838
with:
2939
timezoneLinux: "Europe/Paris"
3040
- uses: actions/checkout@v4
41+
# Round-robin over the sorted spec list rather than a hand-maintained list per
42+
# shard: every spec is always picked up by exactly one shard, including new ones,
43+
# and interleaving the sorted order spreads the slow directories evenly.
44+
- name: Select the specs for this shard
45+
id: shard
46+
run: |
47+
specs=$(find cypress/e2e -name '*.cy.js' | sort \
48+
| awk -v i="${{ matrix.shard }}" -v n="$SHARD_TOTAL" '(NR - 1) % n == (i - 1)' \
49+
| paste -sd, -)
50+
if [ -z "$specs" ]; then echo "No spec selected for this shard" >&2; exit 1; fi
51+
echo "Shard ${{ matrix.shard }}/$SHARD_TOTAL: $(echo "$specs" | tr ',' '\n' | wc -l) specs"
52+
echo "specs=$specs" >> "$GITHUB_OUTPUT"
3153
- name: Run CoopCycle Web
3254
uses: ./.github/actions/run-coopcycle-web
3355
timeout-minutes: 10
@@ -43,14 +65,13 @@ jobs:
4365
# Install only Cypress binary; everything else is already installed by the webpack docker image
4466
# https://docs.cypress.io/app/continuous-integration/overview#Missing-binary
4567
install-command: npx cypress install
46-
spec: |
47-
cypress/e2e/**/*.cy.js
68+
spec: ${{ steps.shard.outputs.specs }}
4869
# after the test run completes store videos and any screenshots
4970
- name: Upload images for failed tests
5071
uses: actions/upload-artifact@v4
5172
if: failure()
5273
with:
53-
name: cypress-screenshots
74+
name: cypress-screenshots-shard-${{ matrix.shard }}
5475
path: cypress/screenshots
5576
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn`
5677
- name: Show Symfony warnings on failure
@@ -59,3 +80,5 @@ jobs:
5980
- name: Upload Symfony logs on failure
6081
if: failure()
6182
uses: ./.github/actions/upload-symfony-logs
83+
with:
84+
name: symfony-logs-shard-${{ matrix.shard }}

.github/workflows/test_js.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Unit Tests (JS)
22
on: push
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
36
env:
47
APP_ENV: test
58
NODE_ENV: test
@@ -10,14 +13,25 @@ jobs:
1013
env:
1114
STRIPE_PUBLISHABLE_KEY: ${{ secrets.STRIPE_PUBLISHABLE_KEY }}
1215
STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }}
16+
# Some assertions compare formatted numbers, which depend on the ambient ICU
17+
# locale. The webpack container this used to run in has no LANG set, so Node
18+
# falls back to en-US; pin the same thing here.
19+
LANG: C.UTF-8
1320
steps:
1421
- name: Set timezone
1522
uses: szenius/set-timezone@v2.0
1623
with:
1724
timezoneLinux: "Europe/Paris"
1825
- uses: actions/checkout@v4
19-
- name: Run CoopCycle Web
20-
uses: ./.github/actions/run-coopcycle-web
21-
timeout-minutes: 10
26+
# Jest only runs jsdom unit tests under js/, it needs neither the app nor any of
27+
# the containers, so it does not use ./.github/actions/run-coopcycle-web. Node 22
28+
# matches the "node:22-alpine" image these tests used to run in.
29+
- uses: actions/setup-node@v4
30+
with:
31+
node-version: '22'
32+
cache: 'npm'
33+
- name: Install dependencies
34+
# The Cypress binary is not needed to run Jest, and takes a while to download
35+
run: CYPRESS_INSTALL_BINARY=0 npm ci
2236
- name: Run Jest
23-
run: docker compose exec -T webpack npm run jest
37+
run: npm run jest

.github/workflows/test_php_unit.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Unit Tests (PHP)
22
on: push
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
36
env:
47
APP_ENV: test
58
NODE_ENV: test
@@ -25,6 +28,9 @@ jobs:
2528
- uses: actions/checkout@v4
2629
- name: Run CoopCycle Web
2730
uses: ./.github/actions/run-coopcycle-web
31+
with:
32+
# PHPUnit never renders a page including the Encore entrypoints
33+
wait-for-webpack: 'false'
2834
timeout-minutes: 10
2935
- name: Run PHPUnit
3036
run: |

0 commit comments

Comments
 (0)