feat(E2E): testing #4
Workflow file for this run
This file contains hidden or 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: Frontend Test | |
| on: | |
| push: | |
| paths: | |
| - '.github/workflows/frontend-test.yml' | |
| - 'web' | |
| pull_request: | |
| paths: | |
| - '.github/workflows/frontend-test.yml' | |
| - 'web' | |
| jobs: | |
| e2e-tests: | |
| name: E2E Testing (Real APIs) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ ubuntu-latest ] | |
| php-version: [ '8.1' ] | |
| sw-version: [ '5.0.3' ] | |
| node-version: [ '20' ] | |
| env: | |
| SW_VERSION: ${{ matrix.sw-version }} | |
| MYSQL_VERSION: '8.0' | |
| PGSQL_VERSION: '14' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP TS | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| extensions: redis, pdo, pdo_mysql,sqlsrv,pdo_sqlsrv,pdo_odbc,bcmath,swoole-${{ matrix.sw-version }} | |
| ini-values: opcache.enable_cli=0 | |
| env: | |
| phpts: ts | |
| - name: Set Swoole Shortname | |
| run: | | |
| sudo sh -c "echo swoole.use_shortname='Off' >> /etc/php/${{ matrix.php-version }}/cli/conf.d/swoole.ini" | |
| php --ri swoole | |
| - name: Setup Backend Packages | |
| run: .github/ci/requirement.install.sh | |
| - name: Setup Services | |
| run: .github/ci/setup.services.sh | |
| - name: Setup Mysql | |
| run: bash .github/ci/setup.mysql.sh | |
| - name: Run Scripts Before Test | |
| run: cp .github/ci/.env.example .env | |
| - name: Print PHP Environments | |
| run: | | |
| sudo rm -rf /etc/php/${{ matrix.php-version }}/cli/conf.d/20-xdebug.ini | |
| php -i | |
| php -m | |
| - name: Install PNPM | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Setup Frontend Packages | |
| working-directory: web | |
| run: .github/ci/requirement.install.sh | |
| - name: Start Backend Server | |
| working-directory: web | |
| run: .github/ci/run.start-backend-server.sh | |
| env: | |
| DB_DRIVER: mysql | |
| DB_HOST: 127.0.0.1 | |
| DB_DATABASE: mineadmin | |
| - name: Run E2E Tests | |
| working-directory: web | |
| run: .github/ci/run.test.sh | |
| - name: Upload E2E Test Report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: web/playwright-report/ | |
| retention-days: 1 | |
| - name: Stop Backend Server | |
| if: always() | |
| working-directory: web | |
| run: .github/ci/run.stop-backend-server.sh |