diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml index 309fd07..967503f 100644 --- a/.github/workflows/bump.yml +++ b/.github/workflows/bump.yml @@ -31,13 +31,33 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + - name: Set up docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build docker image + uses: docker/build-push-action@v5 + with: + context: ./api + target: php_dev + tags: local:latest + load: true + cache-from: type=gha + cache-to: type=gha,mode=max + push: false + - name: Generate OpenAPI contract + uses: addnab/docker-run-action@v3 + with: + image: local:latest + options: -v ${{github.workspace}}/api:/srv/app -v /srv/app/vendor + run: | + composer require symfony/runtime + php bin/console api:openapi:export > openapi.json - name: Comment pull request with API diff uses: bump-sh/github-action@v1 with: doc: apiplatform-test-demo token: ${{secrets.BUMP_TOKEN}} - file: docs/openapi.json + file: api/openapi.json command: diff env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/api/src/Entity/Book.php b/api/src/Entity/Book.php index 5f359e8..1b006f0 100644 --- a/api/src/Entity/Book.php +++ b/api/src/Entity/Book.php @@ -4,7 +4,6 @@ use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\Get; use ApiPlatform\Metadata\Put; -use ApiPlatform\Metadata\Delete; use ApiPlatform\Metadata\GetCollection; use ApiPlatform\Metadata\Post; use Doctrine\Common\Collections\ArrayCollection; @@ -15,7 +14,6 @@ operations: [ new Get(), new Put(), - new Delete(), new GetCollection(), new Post(), ] diff --git a/api/src/Entity/Review.php b/api/src/Entity/Review.php index c645421..b93c4ed 100644 --- a/api/src/Entity/Review.php +++ b/api/src/Entity/Review.php @@ -4,6 +4,7 @@ use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\Get; use ApiPlatform\Metadata\Put; +use ApiPlatform\Metadata\Delete; use ApiPlatform\Metadata\GetCollection; use ApiPlatform\Metadata\Post; use ApiPlatform\Metadata\Patch; @@ -14,6 +15,7 @@ operations: [ new Get(), new Put(), + new Delete(), new GetCollection(), new Post(), new Patch(),