💚(app-desk) add template mail for e2e
The tests e2e need the mail template to send the invitation to the user. We are now caching the mail template instead of using a artifact, thanks to that we can build only the mail template if the cache is invalidated, so we save time and resources.
This commit is contained in:
24
.github/workflows/impress-frontend.yml
vendored
24
.github/workflows/impress-frontend.yml
vendored
@@ -6,7 +6,7 @@ on:
|
|||||||
- main
|
- main
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- '*'
|
- "*"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
install-front:
|
install-front:
|
||||||
@@ -19,13 +19,13 @@ jobs:
|
|||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '18.x'
|
node-version: "18.x"
|
||||||
|
|
||||||
- name: Restore the frontend cache
|
- name: Restore the frontend cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
id: front-node_modules
|
id: front-node_modules
|
||||||
with:
|
with:
|
||||||
path: 'src/frontend/**/node_modules'
|
path: "src/frontend/**/node_modules"
|
||||||
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
@@ -36,7 +36,7 @@ jobs:
|
|||||||
if: steps.front-node_modules.outputs.cache-hit != 'true'
|
if: steps.front-node_modules.outputs.cache-hit != 'true'
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: 'src/frontend/**/node_modules'
|
path: "src/frontend/**/node_modules"
|
||||||
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
||||||
|
|
||||||
build-front:
|
build-front:
|
||||||
@@ -50,7 +50,7 @@ jobs:
|
|||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
id: front-node_modules
|
id: front-node_modules
|
||||||
with:
|
with:
|
||||||
path: 'src/frontend/**/node_modules'
|
path: "src/frontend/**/node_modules"
|
||||||
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
||||||
|
|
||||||
- name: Build CI App
|
- name: Build CI App
|
||||||
@@ -73,7 +73,7 @@ jobs:
|
|||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
id: front-node_modules
|
id: front-node_modules
|
||||||
with:
|
with:
|
||||||
path: 'src/frontend/**/node_modules'
|
path: "src/frontend/**/node_modules"
|
||||||
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
||||||
|
|
||||||
- name: Test App
|
- name: Test App
|
||||||
@@ -90,7 +90,7 @@ jobs:
|
|||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
id: front-node_modules
|
id: front-node_modules
|
||||||
with:
|
with:
|
||||||
path: 'src/frontend/**/node_modules'
|
path: "src/frontend/**/node_modules"
|
||||||
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
||||||
|
|
||||||
- name: Check linting
|
- name: Check linting
|
||||||
@@ -110,11 +110,18 @@ jobs:
|
|||||||
make create-env-files
|
make create-env-files
|
||||||
cat env.d/development/common.e2e.dist >> env.d/development/common
|
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
|
- name: Restore the frontend cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
id: front-node_modules
|
id: front-node_modules
|
||||||
with:
|
with:
|
||||||
path: 'src/frontend/**/node_modules'
|
path: "src/frontend/**/node_modules"
|
||||||
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
||||||
|
|
||||||
- name: Restore the build cache
|
- name: Restore the build cache
|
||||||
@@ -152,4 +159,3 @@ jobs:
|
|||||||
name: playwright-report
|
name: playwright-report
|
||||||
path: src/frontend/apps/e2e/report/
|
path: src/frontend/apps/e2e/report/
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
|
|||||||
65
.github/workflows/impress.yml
vendored
65
.github/workflows/impress.yml
vendored
@@ -6,7 +6,7 @@ on:
|
|||||||
- main
|
- main
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- '*'
|
- "*"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint-git:
|
lint-git:
|
||||||
@@ -16,7 +16,7 @@ jobs:
|
|||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: show
|
- name: show
|
||||||
run: git log
|
run: git log
|
||||||
- name: Enforce absence of print statements in code
|
- name: Enforce absence of print statements in code
|
||||||
@@ -63,22 +63,38 @@ jobs:
|
|||||||
working-directory: src/mail
|
working-directory: src/mail
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Node.js
|
- name: Install Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '18'
|
node-version: "18"
|
||||||
- name: Install yarn
|
|
||||||
run: npm install -g yarn
|
- name: Restore the mail templates
|
||||||
- name: Install node dependencies
|
uses: actions/cache@v4
|
||||||
run: yarn install --frozen-lockfile
|
id: mail-templates
|
||||||
- name: Build mails
|
|
||||||
run: yarn build
|
|
||||||
- name: Persist mails' templates
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: mails-templates
|
path: "src/backend/core/templates/mail"
|
||||||
path: src/backend/core/templates/mail
|
key: mail-templates-${{ hashFiles('src/mail/mjml') }}
|
||||||
|
|
||||||
|
- name: Install yarn
|
||||||
|
if: steps.mail-templates.outputs.cache-hit != 'true'
|
||||||
|
run: npm install -g yarn
|
||||||
|
|
||||||
|
- name: Install node dependencies
|
||||||
|
if: steps.mail-templates.outputs.cache-hit != 'true'
|
||||||
|
run: yarn install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Build mails
|
||||||
|
if: steps.mail-templates.outputs.cache-hit != 'true'
|
||||||
|
run: yarn build
|
||||||
|
|
||||||
|
- name: Cache mail templates
|
||||||
|
if: steps.mail-templates.outputs.cache-hit != 'true'
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: "src/backend/core/templates/mail"
|
||||||
|
key: mail-templates-${{ hashFiles('src/mail/mjml') }}
|
||||||
|
|
||||||
lint-back:
|
lint-back:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -91,7 +107,7 @@ jobs:
|
|||||||
- name: Install Python
|
- name: Install Python
|
||||||
uses: actions/setup-python@v3
|
uses: actions/setup-python@v3
|
||||||
with:
|
with:
|
||||||
python-version: '3.10'
|
python-version: "3.10"
|
||||||
- name: Install development dependencies
|
- name: Install development dependencies
|
||||||
run: pip install --user .[dev]
|
run: pip install --user .[dev]
|
||||||
- name: Check code formatting with ruff
|
- name: Check code formatting with ruff
|
||||||
@@ -101,7 +117,6 @@ jobs:
|
|||||||
- name: Lint code with pylint
|
- name: Lint code with pylint
|
||||||
run: ~/.local/bin/pylint .
|
run: ~/.local/bin/pylint .
|
||||||
|
|
||||||
|
|
||||||
test-back:
|
test-back:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build-mails
|
needs: build-mails
|
||||||
@@ -146,11 +161,12 @@ jobs:
|
|||||||
sudo mkdir -p /data/media && \
|
sudo mkdir -p /data/media && \
|
||||||
sudo mkdir -p /data/static
|
sudo mkdir -p /data/static
|
||||||
|
|
||||||
- name: Download mails' templates
|
- name: Restore the mail templates
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/cache@v4
|
||||||
|
id: mail-templates
|
||||||
with:
|
with:
|
||||||
name: mails-templates
|
path: "src/backend/core/templates/mail"
|
||||||
path: src/backend/core/templates/mail
|
key: mail-templates-${{ hashFiles('src/mail/mjml') }}
|
||||||
|
|
||||||
- name: Start Minio
|
- name: Start Minio
|
||||||
run: |
|
run: |
|
||||||
@@ -174,7 +190,7 @@ jobs:
|
|||||||
- name: Install Python
|
- name: Install Python
|
||||||
uses: actions/setup-python@v3
|
uses: actions/setup-python@v3
|
||||||
with:
|
with:
|
||||||
python-version: '3.10'
|
python-version: "3.10"
|
||||||
|
|
||||||
- name: Install development dependencies
|
- name: Install development dependencies
|
||||||
run: pip install --user .[dev]
|
run: pip install --user .[dev]
|
||||||
@@ -204,7 +220,7 @@ jobs:
|
|||||||
- name: Install Python
|
- name: Install Python
|
||||||
uses: actions/setup-python@v3
|
uses: actions/setup-python@v3
|
||||||
with:
|
with:
|
||||||
python-version: '3.10'
|
python-version: "3.10"
|
||||||
|
|
||||||
- name: Install development dependencies
|
- name: Install development dependencies
|
||||||
working-directory: src/backend
|
working-directory: src/backend
|
||||||
@@ -222,8 +238,8 @@ jobs:
|
|||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '18.x'
|
node-version: "18.x"
|
||||||
cache: 'yarn'
|
cache: "yarn"
|
||||||
cache-dependency-path: src/frontend/yarn.lock
|
cache-dependency-path: src/frontend/yarn.lock
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
@@ -242,4 +258,3 @@ jobs:
|
|||||||
-v "${{ github.workspace }}:/app" \
|
-v "${{ github.workspace }}:/app" \
|
||||||
crowdin/cli:3.16.0 \
|
crowdin/cli:3.16.0 \
|
||||||
crowdin upload sources -c /app/crowdin/config.yml
|
crowdin upload sources -c /app/crowdin/config.yml
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user