Skip to content

improve email service #521

improve email service

improve email service #521

Workflow file for this run

on:
pull_request:
jobs:
ci-back:
runs-on: ubuntu-latest
defaults:
run:
working-directory: back
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: |
~/.docker
key: ${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile') }}
restore-keys: |
${{ runner.os }}-docker-
- name: Build Docker images
uses: docker/bake-action@v4
with:
workdir: back
pull: true
load: true
files: |
docker-compose.yml
docker-compose.override.yml
set: |
*.cache-from=type=gha,scope=${{github.ref}}
*.cache-from=type=gha,scope=refs/heads/main
*.cache-to=type=gha,scope=${{github.ref}},mode=max
- name: Start services
run: docker compose up --wait --no-build
env:
BREVO_API_KEY: ${{secrets.BREVO_API_KEY}}
- name: Check HTTP reachability
run: curl -v -o /dev/null http://localhost
- name: Check API reachability
run: curl -vk -o /dev/null https://localhost
- name: Check PWA reachability
run: "curl -vk -o /dev/null -H 'Accept: text/html' https://localhost"
- name: Run PHPUnit tests
run: docker compose exec -T php bin/phpunit
ci-front:
runs-on: ubuntu-latest
needs: ci-back
defaults:
run:
working-directory: front
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup npm
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Cache Next.js build
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
- name: Build
run: pnpm run build
- name: Cache Playwright dependencies
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-playwright-
- name: Install Playwright dependencies
run: pnpm dlx playwright install --with-deps
- name: Run Playwright tests
run: pnpm run test:e2e
- name: Run Vitest tests
run: pnpm run test --no-watch