Fix bolt:setup by running doctrine scripts in new context #972
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: API tests | |
| on: | |
| pull_request: | |
| jobs: | |
| apicurltests: | |
| strategy: | |
| matrix: | |
| php-version: [ '8.2', '8.3', '8.4' ] | |
| database: | |
| - 'sqlite:///%kernel.project_dir%/var/data/bolt.sqlite' | |
| - 'mysql://bolt:bolt@127.0.0.1/bolt?serverVersion=5.7&charset=utf8mb4' | |
| name: curl tests | |
| services: | |
| mysql: | |
| image: mysql:5.7 | |
| ports: | |
| - "3306:3306" | |
| env: | |
| MYSQL_DATABASE: bolt | |
| MYSQL_USER: bolt | |
| MYSQL_PASSWORD: bolt | |
| MYSQL_ROOT_PASSWORD: bolt | |
| options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
| runs-on: ubuntu-latest | |
| env: | |
| DATABASE_URL: ${{matrix.database}} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: shivammathur/setup-php@v2 | |
| with: | |
| # test the lowest version, to make sure checks pass on it | |
| php-version: ${{ matrix.php-version }} | |
| extensions: json, mbstring, pdo, curl, pdo_sqlite | |
| coverage: none | |
| tools: symfony-cli | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Cache Composer dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: /tmp/composer-cache | |
| key: ${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.json') }} | |
| - uses: php-actions/composer@v6 | |
| with: | |
| php_version: ${{ matrix.php-version }} | |
| - name: Initialise folders | |
| run: sudo chmod -R 777 config/ public/files/ public/theme/ public/thumbs/ var/ | |
| - name: create the database | |
| run: ./bin/console doctrine:database:create | |
| if: ${{ startsWith('sqlite', matrix.database) }} | |
| - name: Initialise the database | |
| run: ./bin/console doctrine:schema:create | |
| - name: Starting server | |
| run: symfony server:start --no-tls --port=8088 -d | |
| - name: create api user | |
| run: php bin/console bolt:add-user apiuser apiuser%1 api@example.org API --roles=ROLE_WEBSERVICE | |
| - name: check API user gets content | |
| run: curl -fkI -u apiuser:apiuser%1 http://localhost:8088/api/contents | |
| - name: check API user gets fields | |
| run: curl -fkI -u apiuser:apiuser%1 http://localhost:8088/api/fields | |
| - name: check API user gets relations | |
| run: curl -fkI -u apiuser:apiuser%1 http://localhost:8088/api/relations |