Skip to content

Bump @polkadot-api/cli from 0.14.15 to 0.18.0 #232

Bump @polkadot-api/cli from 0.14.15 to 0.18.0

Bump @polkadot-api/cli from 0.14.15 to 0.18.0 #232

Workflow file for this run

name: Regular E2E
on:
pull_request:
branches:
- main
push:
branches:
- main
permissions:
id-token: write
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
MONGODB_HOST: localhost
MONGODB_PORT: 27017
API_PORT: 4000
APP_PORT: 3000
HOST: 0.0.0.0
NODE_ENV: test
jobs:
test:
runs-on: ubuntu-latest
environment: ${{ github.event_name == 'push' && 'production' || 'test' }}
services:
mongodb:
image: mongo:7.0.5-jammy
ports:
- 27017:27017
options: >-
--health-cmd "mongosh --eval 'db.hello()'"
--health-interval 3s
--health-timeout 2s
--health-retries 5
steps:
- name: Create codebase directory
run: mkdir -p codebase
- name: Checkout repository
uses: actions/checkout@v4
with:
path: codebase/app
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.1.29
- name: Set up environment variables for APP
working-directory: codebase/app
run: |
touch .env
echo "NODE_ENV=${{ env.NODE_ENV }}" >> .env
echo "HOST=${{ env.HOST }}" >> .env
echo "PORT=${{ env.APP_PORT }}" >> .env
echo "NEXT_PUBLIC_BASE_URL=http://${{ env.HOST }}:${{ env.APP_PORT }}" >> .env
echo "NEXT_PUBLIC_API_DOMAIN=http://${{ env.HOST }}:${{ env.API_PORT }}" >> .env
- name: Install APP dependencies
working-directory: codebase/app
run: bun i
- name: Clone API
run: |
git clone https://github.com/PolkadotEducation/api.git codebase/api
- name: Set up environment variables for API
working-directory: codebase/api
run: |
touch .env
echo "NODE_ENV=${{ env.NODE_ENV }}" >> .env
echo "HOST=${{ env.HOST }}" >> .env
echo "PORT=${{ env.API_PORT }}" >> .env
echo "MONGODB_URI=mongodb://${{ env.MONGODB_HOST }}:${{ env.MONGODB_PORT }}" >> .env
- name: Install API dependencies
working-directory: codebase/api
run: git checkout ${{ github.event.pull_request.base.ref || github.ref_name }} && bun i
- name: Create logs directory
run: mkdir -p logs
- name: Start API
working-directory: codebase/api
run: bun dev > ../../logs/api.log 2>&1 &
- name: Start APP
working-directory: codebase/app
run: bun dev > ../../logs/app.log 2>&1 &
- name: Test with Cypress (excluding backoffice)
working-directory: codebase/app
run: bun run wait && bun run test:regular
- name: Upload screenshots
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
include-hidden-files: true
path: codebase/app/cypress/screenshots
- name: Upload logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: service-logs
include-hidden-files: true
path: logs