WIP: Refactor Voter application layout #1316
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
name: Main tests & validation | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '**.md' | |
- '**/*/.env.example' | |
- '.env.example' | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- ready_for_review | |
branches: | |
- main | |
paths-ignore: | |
- '**.md' | |
- '**/*/.env.example' | |
- '.env.example' | |
jobs: | |
frontend-validation: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: 'frontend' | |
steps: | |
- name: "Checkout Frontend source code" | |
uses: actions/checkout@v3 | |
- name: Setup Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
cache: "yarn" | |
- name: "Install shared module dependencies" | |
run: yarn workspace vaa-shared install --frozen-lockfile | |
- name: "Build shared module" | |
run: yarn workspace vaa-shared build | |
- name: "Install Frontend dependencies" | |
run: yarn install --frozen-lockfile | |
- name: "Run Prettier check on frontend" | |
run: yarn prettier:check | |
- name: "Run ESlint check on frontend" | |
run: yarn lint | |
- name: "Check that TranslationKey type is up to date" | |
run: yarn generateTranslationKeyType && git diff --exit-code | |
- name: "Run Frontend tests" | |
run: yarn test | |
- name: "Build frontend" | |
run: yarn build | |
backend-validation: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: backend/vaa-strapi | |
steps: | |
- name: "Checkout Backend source code" | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Setup Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
cache: "yarn" | |
- name: Cache node modules | |
id: cache-npm-backend-main | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: "backend/vaa-strapi/node_modules" | |
key: ${{ runner.os }}-backend-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: "Install shared module dependencies" | |
run: yarn workspace vaa-shared install --frozen-lockfile | |
- name: "Build shared module" | |
run: yarn workspace vaa-shared build | |
- name: "Install Backend yarn dependencies" | |
run: | | |
yarn install --frozen-lockfile | |
- name: "Run Prettier check on Backend" | |
run: | | |
yarn prettier:check | |
- name: "Run ESLint on backend" | |
run: | | |
yarn lint | |
# - name: "Run Backend tests" | |
# run: | | |
# npm run test | |
- name: "Install import-export-entries dependencies" | |
run: | | |
cd strapi-plugin-import-export-entries | |
yarn install --frozen-lockfile | |
cd .. | |
- name: "Build import-export-entries" | |
run: | | |
cd strapi-plugin-import-export-entries | |
yarn build | |
cd .. | |
- name: "Build backend" | |
run: | | |
yarn build | |
e2e-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout source code" | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: "Configure environment" | |
run: cp .env.example .env | |
- name: Setup Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
cache: "yarn" | |
- name: Cache node modules | |
id: cache-npm-e2e-main | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules-e2e | |
with: | |
path: "node_modules" | |
key: ${{ runner.os }}-e2e-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: "Install yarn dependencies" | |
run: yarn install --frozen-lockfile | |
- name: "Install playwright" | |
run: yarn playwright install | |
- name: "Start OpenVAA" | |
run: yarn dev | |
- name: "Run E2E tests" | |
run: yarn test | |
- name: "Upload playwright setup report" | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-setup-report | |
path: playwright-setup-report/ | |
retention-days: 30 | |
- name: "Upload playwright report" | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 | |
- name: "Stop OpenVAA" | |
if: always() | |
run: yarn dev:down |