Skip to content

Add nixpack as template to easily deploy #13

Add nixpack as template to easily deploy

Add nixpack as template to easily deploy #13

Workflow file for this run

name: Testing
on:
pull_request:
branches:
- develop
jobs:
CODE_STYLE:
name: CODE STYLE
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run PHP-CS-Fixer
uses: erkenes/php-cs-fixer-action@main
with:
args: '--dry-run --diff -vvv'
PHP_UNIT:
name: PHP UNIT
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Add default env values
run: cp .env.sample .env # sudo echo "127.0.0.1 db" | sudo tee -a /etc/hosts
- uses: hoverkraft-tech/[email protected]
with:
compose-file: "docker-compose.yaml"
services: "web"
up-flags: "-d --wait"
down-flags: "-v"
- name: Run migrations
run: |
docker compose exec web chmod 777 var/logs/
docker compose exec web chmod 777 var/private-files/
docker compose exec web chmod 777 var/sessions/
docker compose exec web chmod 777 var/DoctrineProxies/
docker compose exec web php src/tools/apply-updates.php
docker compose exec web php app/bin/doctrine migrations:migrate --no-interaction --all-or-nothing
env:
APP_MODE: development
- name: Run Phpunit tests
run: |
docker compose exec web ./vendor/bin/phpunit -c phpunit.xml
CYPRESS_E2E:
timeout-minutes: 15
runs-on: ubuntu-latest
# container:
# image: cypress/browsers:node-20.12.0-chrome-123.0.6312.86-1-ff-124.0.2-edge-123.0.2420.65-1
# options: --user 1001
# needs: install
# strategy:
# # when one test fails, DO NOT cancel the other
# # containers, because this will kill Cypress processes
# # leaving Cypress Cloud hanging ...
# # https://github.com/cypress-io/github-action/issues/48
# fail-fast: false
# matrix:
# # run copies of the current job in parallel
# containers: [1, 2, 3, 4, 5]
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Add default env values
run: cp .env.sample .env
- uses: hoverkraft-tech/[email protected]
with:
compose-file: "docker-compose.yaml"
services: "web"
up-flags: "-d --wait"
down-flags: "-v"
- name: Run migrations
run: |
docker compose exec web chmod 777 var/logs/
docker compose exec web chmod 777 var/private-files/
docker compose exec web chmod 777 var/sessions/
docker compose exec web chmod 777 var/DoctrineProxies/
docker compose exec web php src/tools/apply-updates.php
docker compose exec web php app/bin/doctrine migrations:migrate --no-interaction --all-or-nothing
env:
APP_MODE: development
# - name: Download the build folders
# uses: actions/download-artifact@v4
# with:
# name: build
# path: build
- name: "UI Tests - Chrome - Mobile"
uses: cypress-io/github-action@v6
with:
# config: '{"e2e":{"viewportWidth":375,"viewportHeight":667}}'
# start: pnpm run cypress:run
wait-on: "http://web"
wait-on-timeout: 120
browser: chrome
record: true
parallel: true
group: "UI - Chrome - Mobile"
spec: src/cypress/*
config-file: src/cypress/cypress.config.js
env:
# CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
# CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# Recommended: pass the GitHub token lets this action correctly
# determine the unique run id necessary to re-run the checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Install composer and dependencies
# uses: php-actions/composer@v6
# with:
# php_extensions: pdo_pgsql zip intl gd mbstring curl xml
# - name: PHPUnit Tests Mapas
# uses: php-actions/phpunit@v3
# env:
# XDEBUG_MODE: coverage
# with:
# version: 10.5
# php_version: 8.2
# configuration: phpunit.xml
# php_extensions: pdo_pgsql zip intl gd mbstring curl xml
# args: tests --coverage-clover ./coverage.xml
# - name: Upload to Codecov
# uses: codecov/codecov-action@v2
# with:
# token: ${{ secrets.CODE_COV_TOKEN }}
# files: ./coverage.xml
# verbose: true