Issue #113: open dbeaver app up and focus on it. Also fix behat/phpunit execution with public folder for moodle 5.1+ #215
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: Test MChef | |
| on: | |
| pull_request: | |
| branches: [main, master, develop] | |
| paths-ignore: | |
| - "README.md" | |
| - "LICENSE" | |
| - "docs/**" | |
| - ".gitignore" | |
| push: | |
| branches: [main, master, develop] | |
| paths-ignore: | |
| - "README.md" | |
| - "LICENSE" | |
| - "docs/**" | |
| - ".gitignore" | |
| workflow_dispatch: # Allow manual triggering | |
| env: | |
| DOCKER_BUILDKIT: 1 | |
| COMPOSE_DOCKER_CLI_BUILD: 1 | |
| jobs: | |
| unit-tests: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: "8.2" | |
| extensions: mbstring, xml, ctype, iconv, intl, pdo, pdo_mysql, pdo_pgsql | |
| coverage: none | |
| - name: Validate composer.json and composer.lock | |
| run: composer validate --strict | |
| - name: Cache Composer packages | |
| id: composer-cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php- | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress | |
| - name: Run PHPUnit tests | |
| run: php vendor/bin/phpunit src/Tests/ --testdox | |
| - name: Test MChef CLI basic functionality | |
| run: | | |
| php mchef.php --help | |
| php mchef.php --version || echo "No version flag available" | |
| integration-test: | |
| name: Integration Tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 25 | |
| needs: unit-tests | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Set up PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: "8.2" | |
| extensions: mbstring, xml, ctype, iconv, intl, pdo, pdo_pgsql | |
| coverage: none | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress | |
| - name: Run comprehensive integration tests | |
| run: | | |
| chmod +x src/Tests/Integration/Bash/test-mchef.sh | |
| src/Tests/Integration/Bash/test-mchef.sh --prefix ci-test --timeout 600 | |
| # Required status check job that all other jobs depend on | |
| all-tests-passed: | |
| name: All Tests Passed | |
| runs-on: ubuntu-latest | |
| needs: [unit-tests, integration-test] | |
| if: always() | |
| steps: | |
| - name: Check test results | |
| run: | | |
| echo "Unit tests status: ${{ needs.unit-tests.result }}" | |
| echo "Integration tests status: ${{ needs.integration-test.result }}" | |
| if [[ "${{ needs.unit-tests.result }}" != "success" ]]; then | |
| echo "❌ Unit tests failed" | |
| exit 1 | |
| fi | |
| if [[ "${{ needs.integration-test.result }}" != "success" ]]; then | |
| echo "❌ Integration tests failed" | |
| exit 1 | |
| fi | |
| echo "✅ All tests passed successfully!" |