Skip to content

CI - Mobile curriculum test #1862

CI - Mobile curriculum test

CI - Mobile curriculum test #1862

name: CI - Mobile curriculum test
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- "mobile-app/**"
push:
branches:
- main
schedule:
- cron: "0 0 * * 0"
jobs:
mobile-test:
name: Test curriculum for mobile app
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [20.x]
steps:
- name: Checkout freeCodeCamp main repo
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
with:
repository: freeCodeCamp/freeCodeCamp
- name: Checkout mobile repo
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
with:
path: mobile
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- name: Setup Flutter 3.22.x
uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 # v2
with:
flutter-version: "3.22.x"
channel: "stable"
cache: true
cache-key: flutter-3.22.x
cache-path: ${{ runner.tool_cache }}/flutter
- name: Set freeCodeCamp Environment Variables
run: cp sample.env .env
- name: Install and Build
run: |
pnpm install
pnpm run create:shared
pnpm run build:curriculum
- name: Generate mobile test files
run: |
cd mobile/mobile-app
echo "DEVELOPMENTMODE=true" > .env
echo "HASHNODE_PUBLICATION_ID=$HASHNODE_PUBLICATION_ID" > .env
flutter pub get
flutter test test/widget_test.dart
- name: Install playwright dependencies
run: npx playwright install --with-deps
- name: Install serve
run: npm install -g serve
- name: Run playwright tests
run: npx playwright test --config=playwright-mobile.config.ts
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4
if: ${{ !cancelled() }}
with:
name: playwright-report-mobile
path: playwright/reporter
retention-days: 30