feat: refactor Adminer integration with policy-based access control a… #889
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] | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| services: | |
| mysql: | |
| image: mysql:8.0 | |
| env: | |
| MYSQL_ROOT_PASSWORD: root | |
| ports: | |
| - 3306:3306 | |
| options: >- | |
| --health-cmd="mysqladmin ping -h localhost" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: root | |
| POSTGRES_PASSWORD: root | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd="pg_isready -U postgres" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| mongodb: | |
| image: mongo:8 | |
| env: | |
| MONGO_INITDB_ROOT_USERNAME: root | |
| MONGO_INITDB_ROOT_PASSWORD: root | |
| ports: | |
| - 27017:27017 | |
| options: >- | |
| --health-cmd="mongosh --eval 'db.adminCommand({ping:1})' --quiet" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| redis: | |
| image: redis:7 | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd="redis-cli ping" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| ssh: | |
| image: linuxserver/openssh-server:latest | |
| env: | |
| PUID: 1000 | |
| PGID: 1000 | |
| TZ: UTC | |
| USER_NAME: testuser | |
| USER_PASSWORD: testpass | |
| PASSWORD_ACCESS: "true" | |
| DOCKER_MODS: linuxserver/mods:openssh-server-ssh-tunnel | |
| ports: | |
| - 2222:2222 | |
| options: >- | |
| --health-cmd="netstat -tlnp | grep ':2222' || exit 1" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=10 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.5 | |
| tools: composer:v2 | |
| coverage: pcov | |
| extensions: pdo, pdo_mysql, pdo_pgsql, mongodb-2.3.0, sockets | |
| - name: Install System Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y mysql-client postgresql-client redis-tools zstd p7zip-full sshpass sqlite3 | |
| # Install MongoDB tools (mongodump, mongorestore) | |
| wget -qO - https://www.mongodb.org/static/pgp/server-8.0.asc | sudo gpg --dearmor -o /usr/share/keyrings/mongodb-server-8.0.gpg | |
| echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list | |
| sudo apt-get update | |
| sudo apt-get install -y mongodb-database-tools | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| - name: Install Dependencies | |
| run: composer install --no-interaction --prefer-dist --optimize-autoloader | |
| - name: Install Node Dependencies | |
| run: npm i | |
| - name: Build Assets | |
| run: npm run build | |
| - name: Generate Application Key | |
| run: php artisan key:generate | |
| - name: Run Pint | |
| run: vendor/bin/pint | |
| - name: Run phpstan | |
| run: vendor/bin/phpstan analyse | |
| - name: Run Tests | |
| env: | |
| MYSQL_CLI_TYPE: mysql | |
| DB_HOST: 127.0.0.1 | |
| TEST_MYSQL_HOST: 127.0.0.1 | |
| TEST_POSTGRES_HOST: 127.0.0.1 | |
| TEST_REDIS_HOST: 127.0.0.1 | |
| TEST_MONGODB_HOST: 127.0.0.1 | |
| TEST_SSH_HOST: 127.0.0.1 | |
| run: | | |
| php artisan migrate --force | |
| php artisan test --parallel --coverage-clover=coverage.xml --log-junit junit.xml | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| report_type: coverage | |
| files: coverage.xml | |
| - name: Upload test results to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| report_type: test_results |