This commit introduces a boilerplate inspired by https://github.com/numerique-gouv/impress. The code has been cleaned to remove unnecessary Impress logic and dependencies. Changes made: - Removed Minio, WebRTC, and create bucket from the stack. - Removed the Next.js frontend (it will be replaced by Vite). - Cleaned up impress-specific backend logics. The whole stack remains functional: - All tests pass. - Linter checks pass. - Agent Connexion sources are already set-up. Why clear out the code? To adhere to the KISS principle, we aim to maintain a minimalist codebase. Cloning Impress allowed us to quickly inherit its code quality tools and deployment configurations for staging, pre-production, and production environments. What’s broken? - The tsclient is not functional anymore. - Some make commands need to be fixed. - Helm sources are outdated. - Naming across the project sources are inconsistent (impress, visio, etc.) - CI is not configured properly. This list might be incomplete. Let's grind it.
172 lines
4.5 KiB
YAML
172 lines
4.5 KiB
YAML
name: impress Workflow
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- "*"
|
|
|
|
jobs:
|
|
install-front:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "18.x"
|
|
|
|
- name: Restore the frontend cache
|
|
uses: actions/cache@v4
|
|
id: front-node_modules
|
|
with:
|
|
path: "src/frontend/**/node_modules"
|
|
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
|
|
|
- name: Install dependencies
|
|
if: steps.front-node_modules.outputs.cache-hit != 'true'
|
|
run: cd src/frontend/ && yarn install --frozen-lockfile
|
|
|
|
- name: Cache install frontend
|
|
if: steps.front-node_modules.outputs.cache-hit != 'true'
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: "src/frontend/**/node_modules"
|
|
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
|
|
|
build-front:
|
|
runs-on: ubuntu-latest
|
|
needs: install-front
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Restore the frontend cache
|
|
uses: actions/cache@v4
|
|
id: front-node_modules
|
|
with:
|
|
path: "src/frontend/**/node_modules"
|
|
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
|
|
|
- name: Build CI App
|
|
run: cd src/frontend/ && yarn ci:build
|
|
|
|
- name: Cache build frontend
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: src/frontend/apps/impress/out/
|
|
key: build-front-${{ github.run_id }}
|
|
|
|
test-front:
|
|
runs-on: ubuntu-latest
|
|
needs: install-front
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Restore the frontend cache
|
|
uses: actions/cache@v4
|
|
id: front-node_modules
|
|
with:
|
|
path: "src/frontend/**/node_modules"
|
|
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
|
|
|
- name: Test App
|
|
run: cd src/frontend/ && yarn app:test
|
|
|
|
lint-front:
|
|
runs-on: ubuntu-latest
|
|
needs: install-front
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Restore the frontend cache
|
|
uses: actions/cache@v4
|
|
id: front-node_modules
|
|
with:
|
|
path: "src/frontend/**/node_modules"
|
|
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
|
|
|
- name: Check linting
|
|
run: cd src/frontend/ && yarn lint
|
|
|
|
test-e2e:
|
|
runs-on: ubuntu-latest
|
|
needs: build-front
|
|
timeout-minutes: 15
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set services env variables
|
|
run: |
|
|
make data/media
|
|
make create-env-files
|
|
cat env.d/development/common.e2e.dist >> env.d/development/common
|
|
|
|
- name: Restore the mail templates
|
|
uses: actions/cache@v4
|
|
id: mail-templates
|
|
with:
|
|
path: "src/backend/core/templates/mail"
|
|
key: mail-templates-${{ hashFiles('src/mail/mjml') }}
|
|
|
|
- name: Restore the frontend cache
|
|
uses: actions/cache@v4
|
|
id: front-node_modules
|
|
with:
|
|
path: "src/frontend/**/node_modules"
|
|
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
|
|
|
- name: Restore the build cache
|
|
uses: actions/cache@v4
|
|
id: cache-build
|
|
with:
|
|
path: src/frontend/apps/impress/out/
|
|
key: build-front-${{ github.run_id }}
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build the Docker images
|
|
uses: docker/bake-action@v4
|
|
with:
|
|
targets: |
|
|
app-dev
|
|
y-webrtc-signaling
|
|
load: true
|
|
set: |
|
|
*.cache-from=type=gha,scope=cached-stage
|
|
*.cache-to=type=gha,scope=cached-stage,mode=max
|
|
|
|
- name: Start Docker services
|
|
run: |
|
|
make run
|
|
|
|
- name: Apply DRF migrations
|
|
run: |
|
|
make migrate
|
|
|
|
- name: Add dummy data
|
|
run: |
|
|
make demo FLUSH_ARGS='--no-input'
|
|
|
|
- name: Install Playwright Browsers
|
|
run: cd src/frontend/apps/e2e && yarn install
|
|
|
|
- name: Run e2e tests
|
|
run: cd src/frontend/ && yarn e2e:test
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
if: always()
|
|
with:
|
|
name: playwright-report
|
|
path: src/frontend/apps/e2e/report/
|
|
retention-days: 7
|