-
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feat/deliveryform-override-price
- Loading branch information
Showing
41 changed files
with
512 additions
and
301 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Run CoopCycle Web | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Create .env file | ||
shell: bash | ||
run: cp .env.dist .env | ||
- name: Pull Docker images | ||
shell: bash | ||
run: docker compose pull --ignore-pull-failures | ||
- name: Prepare OSRM data | ||
shell: bash | ||
run: | | ||
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 | ||
docker compose run -T --rm osrm osrm-extract -p /opt/bicycle.lua /data/data.osm.pbf | ||
docker compose run -T --rm osrm osrm-partition /data/data.osrm | ||
docker compose run -T --rm osrm osrm-customize /data/data.osrm | ||
# Cypress GitHub Action uses npm ci, and it causes a "permission denied" error, | ||
# because it tries to remove the node_modules/ folder, which is mounted with root:root | ||
# We create the node_modules/ folder *BEFORE* starting the containers, | ||
# so that it can be removed without problems. | ||
- name: Create node_modules directory | ||
shell: bash | ||
run: mkdir node_modules | ||
- name: Start Docker containers | ||
shell: bash | ||
run: docker compose up -d | ||
- name: Wait for PHP-FPM | ||
shell: bash | ||
run: until docker inspect --format='{{ .State.Health.Status }}' $(docker compose ps -q php) | grep -wq healthy; do sleep 5; done | ||
- name: Wait webpack | ||
shell: bash | ||
run: until [ -f "web/build/entrypoints.json" ]; do sleep 5; done | ||
- name: Create database | ||
shell: bash | ||
run: docker compose exec -T php bin/console doctrine:schema:create --env=test | ||
- name: Create typesense collections | ||
shell: bash | ||
run: docker compose exec -T php bin/console typesense:create --env=test | ||
- name: Validate database schema | ||
shell: bash | ||
run: docker compose exec -T php bin/console doctrine:schema:validate --env=test --skip-sync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
name: Show Symfony warnings | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Show warnings for the test environment | ||
shell: bash | ||
run: docker compose exec -T php cat var/logs/test-$(date +'%Y-%m-%d').log | grep -v -e DEBUG -e INFO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Upload Symfony logs | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Copy Symfony logs | ||
shell: bash | ||
run: docker compose exec -T php cat var/logs/test-$(date +'%Y-%m-%d').log > symfony_logs.log | ||
- name: Upload Symfony logs | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: symfony-logs | ||
path: symfony_logs.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Lint JS | ||
on: push | ||
env: | ||
APP_ENV: test | ||
NODE_ENV: test | ||
jobs: | ||
LINT_JS: | ||
name: Lint JS | ||
runs-on: ubuntu-latest | ||
env: | ||
CYPRESS_INSTALL_BINARY: '0' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install JS dependencies | ||
run: npm ci | ||
- name: Run ESLint | ||
run: node_modules/.bin/eslint --quiet js/app/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Lint PHP | ||
on: push | ||
env: | ||
APP_ENV: test | ||
NODE_ENV: test | ||
jobs: | ||
LINT_PHP: | ||
name: Lint PHP | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php_version: | ||
- '8.2' | ||
- '8.3' | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php_version }} | ||
tools: composer:v2, phpstan:1 | ||
extensions: redis | ||
- name: Install PHP dependencies | ||
run: | | ||
composer install --prefer-dist --no-progress --no-scripts | ||
- name: Run PHPStan | ||
run: phpstan analyse | ||
- name: Clear Symfony cache | ||
run: bin/console cache:clear | ||
- name: Warmup Symfony cache | ||
run: bin/console cache:warmup |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Test Behat | ||
on: push | ||
env: | ||
APP_ENV: test | ||
NODE_ENV: test | ||
jobs: | ||
BEHAT: | ||
name: Run Behat tests | ||
runs-on: ubuntu-latest | ||
env: | ||
STRIPE_PUBLISHABLE_KEY: ${{ secrets.STRIPE_PUBLISHABLE_KEY }} | ||
STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }} | ||
steps: | ||
- name: Set timezone | ||
uses: szenius/[email protected] | ||
with: | ||
timezoneLinux: "Europe/Paris" | ||
- uses: actions/checkout@v2 | ||
- name: Run CoopCycle Web | ||
uses: ./.github/actions/run-coopcycle-web | ||
timeout-minutes: 5 | ||
- name: Run Behat | ||
run: docker compose exec -T php vendor/bin/behat -f progress | ||
- name: Show Symfony warnings on failure | ||
if: failure() | ||
uses: ./.github/actions/show-symfony-warnings | ||
- name: Upload Symfony logs on failure | ||
if: failure() | ||
uses: ./.github/actions/upload-symfony-logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Test Component | ||
on: push | ||
env: | ||
APP_ENV: test | ||
NODE_ENV: test | ||
jobs: | ||
COMPONENT: | ||
name: Run component tests with Cypress | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
country: [fr] | ||
env: | ||
GEOCODE_EARTH_API_KEY: ${{ secrets.GEOCODE_EARTH_API_KEY }} | ||
COOPCYCLE_COUNTRY: ${{ matrix.country }} | ||
COOPCYCLE_LOCALE: ${{ matrix.country }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Run Cypress | ||
uses: cypress-io/github-action@v6 | ||
with: | ||
component: true | ||
spec: cypress/component/**/*.cy.js | ||
- name: Upload images for failed tests | ||
uses: actions/upload-artifact@v4 | ||
if: failure() | ||
with: | ||
name: cypress-screenshots | ||
path: cypress/screenshots | ||
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn` |
Oops, something went wrong.