Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Migrate to attributes #862

Migrate to attributes

Migrate to attributes #862

Workflow file for this run

name: API tests
on:
pull_request:
jobs:
apicurltests:
strategy:
matrix:
php-version: [ '8.1', '8.2', '8.3', '8.4' ]
database:
- 'sqlite:///%kernel.project_dir%/var/data/bolt.sqlite'
- 'mysql://bolt:[email protected]/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: Install composer dependencies
run: composer install --prefer-dist --no-progress
- 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 [email protected] 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