Add/update ci tests #9
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: Tests | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| pull_request: | |
| branches: | |
| - "main" | |
| jobs: | |
| shellcheck: | |
| name: Run ShellCheck | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Run ShellCheck | |
| uses: ludeeus/action-shellcheck@master | |
| build-frontend-only: | |
| name: Build frontend only | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Pterodactyl stable | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: pterodactyl/panel | |
| ref: v1.11.11 | |
| path: panel | |
| - name: Setup Node and Yarn | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'yarn' | |
| cache-dependency-path: panel/yarn.lock | |
| - name: Install Pterodactyl node dependencies | |
| working-directory: panel | |
| run: yarn install | |
| - name: Checkout latest commit | |
| uses: actions/checkout@v4 | |
| with: | |
| path: blueprint | |
| - name: Overwrite Pterodactyl files with latest commit | |
| run: cp -r blueprint/* panel/ | |
| - name: Reinstall node dependencies | |
| working-directory: panel | |
| run: yarn install | |
| - name: Build production frontend | |
| working-directory: panel | |
| run: yarn run build:production | |
| env: | |
| NODE_OPTIONS: --openssl-legacy-provider | |
| test-pterodactyl: | |
| name: Test Pterodactyl | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: [8.2, 8.3] | |
| database: | |
| - mariadb:10.5 | |
| - mariadb:10.11 | |
| - mariadb:11.5 | |
| - mysql:8 | |
| - mysql:9 | |
| services: | |
| database: | |
| image: ${{ matrix.database }} | |
| env: | |
| MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
| MYSQL_DATABASE: testing | |
| ports: | |
| - 3306 | |
| steps: | |
| - name: Checkout Pterodactyl stable | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: pterodactyl/panel | |
| ref: v1.11.11 | |
| path: panel | |
| - name: Install apt dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y curl git gnupg unzip wget zip sed grep gawk inotify-tools | |
| - name: Setup Node and Yarn | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'yarn' | |
| cache-dependency-path: panel/yarn.lock | |
| - name: Checkout latest commit | |
| uses: actions/checkout@v4 | |
| with: | |
| path: blueprint | |
| - name: Overwrite Pterodactyl files with latest commit | |
| run: cp -r blueprint/* panel/ | |
| # This is a temporary and pretty scuffed way to go about this. The current latest | |
| # version of Pterodactyl (v1.11.11) has a broken unit test. Once a new version is | |
| # released, this issue will pretty much be fixed. | |
| - name: Commit overlay changes | |
| working-directory: panel | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add -A | |
| git commit -m "Apply overlay files" | |
| - name: Cherry-pick specific commit from pterodactyl | |
| working-directory: panel | |
| run: | | |
| git fetch origin 1.0-develop | |
| git cherry-pick caab0562561228b02355618904b25dce66550a94 | |
| # This concludes scuffed temporary CI fix. | |
| - name: Install node dependencies | |
| working-directory: panel | |
| run: yarn install | |
| - name: Prepare Blueprint | |
| working-directory: panel | |
| run: | | |
| echo 'WEBUSER="runner"; OWNERSHIP="runner:runner"; USERSHELL="/bin/bash";' > .blueprintrc | |
| chmod +x blueprint.sh | |
| - name: Get cache directory | |
| id: composer-cache | |
| working-directory: panel | |
| run: | | |
| echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-composer-${{ matrix.php }}- | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: bcmath, cli, curl, gd, mbstring, mysql, openssl, pdo, tokenizer, xml, zip | |
| tools: composer:v2 | |
| coverage: none | |
| - name: Setup .env | |
| working-directory: panel | |
| run: cp .env.ci .env | |
| - name: Install dependencies | |
| working-directory: panel | |
| run: composer install --no-interaction --no-progress --no-suggest --prefer-dist | |
| - name: Setup Blueprint | |
| working-directory: panel | |
| run: bash blueprint.sh | |
| env: | |
| BLUEPRINT_ENVIRONMENT: ci | |
| TERM: xterm-kitty #fixes tput errors | |
| - name: Unit tests | |
| working-directory: panel | |
| run: vendor/bin/phpunit --bootstrap vendor/autoload.php tests/Unit | |
| if: ${{ always() }} | |
| env: | |
| DB_HOST: UNIT_NO_DB | |
| - name: Integration tests | |
| working-directory: panel | |
| run: vendor/bin/phpunit tests/Integration | |
| env: | |
| DB_PORT: ${{ job.services.database.ports[3306] }} | |
| DB_USERNAME: root |