Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 11 additions & 32 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,57 +5,36 @@
root = true

[*]
# Change these settings to your own preference
indent_style = space
indent_style = tab
indent_size = 4

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{js,html,ts,tsx}]
indent_size = 2

[*.json]
indent_size = 2
[*.go]
indent_style = tab

[*.md]
trim_trailing_whitespace = false

[*.sh]
indent_style = tab

[*.xml{,.dist}]
indent_style = space
indent_size = 4

[*.{yaml,yml}]
trim_trailing_whitespace = false

[helm/api-platform/**.yaml]
indent_size = 2

[.github/workflows/*.yml]
indent_style = space
indent_size = 2
trim_trailing_whitespace = false

[.gitmodules]
indent_style = tab

[.php_cs{,.dist}]
[*.ini]
indent_style = space
indent_size = 4

[composer.json]
indent_size = 4

[{,docker-}compose{,.*}.{yaml,yml}]
indent_style = space
indent_size = 2
[Makefile]
indent_style = tab

[{,*.*}Dockerfile]
indent_style = tab

[{,*.*}Caddyfile]
indent_style = tab

[*.sh]
indent_style = tab
12 changes: 2 additions & 10 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
* text=auto eol=lf

*.conf text eol=lf
*.html text eol=lf
*.go text eol=lf
*.ini text eol=lf
*.js text eol=lf
*.json text eol=lf
*.md text eol=lf
*.php text eol=lf
*.sh text eol=lf
*.yaml text eol=lf
*.yml text eol=lf
bin/console text eol=lf
composer.lock text eol=lf merge=ours
pnpm-lock.yaml text eol=lf merge=ours

*.ico binary
*.png binary

update-deps.sh export-ignore
.github/CONTRIBUTING.md
.github/workflows/release.yml
go.sum text eol=lf merge=ours
16 changes: 4 additions & 12 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
version: 2

updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
- package-ecosystem: composer
directory: /api
schedule:
interval: daily
labels:
- dependencies
open-pull-requests-limit: 0 # open Pull Requests for security updates only
- package-ecosystem: npm
directory: /pwa
- package-ecosystem: gomod
directory: /
schedule:
interval: daily
interval: weekly
labels:
- dependencies
open-pull-requests-limit: 0 # open Pull Requests for security updates only
open-pull-requests-limit: 5
81 changes: 25 additions & 56 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,68 +12,37 @@ concurrency:
cancel-in-progress: true

jobs:
tests:
name: Tests
build:
name: Build & Test
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build Docker images
uses: docker/bake-action@v6

- name: Set up Go
uses: actions/setup-go@v5
with:
pull: true
load: true
files: |
compose.yaml
compose.override.yaml
set: |
php.cache-from=type=gha,scope=php-${{github.ref}}
php.cache-from=type=gha,scope=php-refs/heads/main
php.cache-to=type=gha,scope=php-${{github.ref}},mode=max
pwa.cache-from=type=gha,scope=pwa-${{github.ref}}
pwa.cache-from=type=gha,scope=pwa-refs/heads/main
pwa.cache-to=type=gha,scope=pwa-${{github.ref}},mode=max
-
name: Start services
run: docker compose up --wait --no-build
-
name: Check HTTP reachability
run: curl -v --fail-with-body http://localhost
-
name: Check API reachability
run: curl -vk --fail-with-body https://localhost
-
name: Check PWA reachability
run: "curl -vk --fail-with-body -H 'Accept: text/html' https://localhost"
-
name: Check Mercure reachability
run: curl -vkI --fail-with-body https://localhost/.well-known/mercure?topic=test
-
name: Create test database
run: docker compose exec -T php bin/console -e test doctrine:database:create
-
name: Run migrations
run: docker compose exec -T php bin/console -e test doctrine:migrations:migrate --no-interaction
-
name: Run PHPUnit
run: docker compose exec -T php bin/phpunit
-
name: Doctrine Schema Validator
run: docker compose exec -T php bin/console -e test doctrine:schema:validate
go-version-file: go.mod

- name: Build
run: go build -v ./...

- name: Vet
run: go vet ./...

lint:
name: Docker Lint
name: Lint
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v4
-
name: Lint Dockerfiles
uses: hadolint/hadolint-action@v3.1.0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: golangci-lint
uses: golangci/golangci-lint-action@v8
with:
recursive: true
version: v2.10
47 changes: 0 additions & 47 deletions .github/workflows/e2e.yml

This file was deleted.

65 changes: 21 additions & 44 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,32 @@
name: Release

permissions:
contents: write
pull-requests: write
contents: write

on:
workflow_dispatch:
inputs:
tag:
description: 'API Platform core tag'
required: true

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
push:
tags:
- "v*"

jobs:
tests:
name: Update api-platform/core
goreleaser:
name: Release
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build Docker images
uses: docker/bake-action@v6
with:
pull: true
load: true
files: |
compose.yaml
compose.override.yaml
set: |
php.cache-from=type=gha,scope=php-${{github.ref}}
php.cache-from=type=gha,scope=php-refs/heads/main
php.cache-to=type=gha,scope=php-${{github.ref}},mode=max
pwa.cache-from=type=gha,scope=pwa-${{github.ref}}
pwa.cache-from=type=gha,scope=pwa-refs/heads/main
pwa.cache-to=type=gha,scope=pwa-${{github.ref}},mode=max
-
name: Update API Platform
run: docker compose run php composer update api-platform/symfony:${{ inputs.tag }} api-platform/doctrine-orm:${{ inputs.tag }}
-
name: Create Pull Request
uses: peter-evans/create-pull-request@v6
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
commit-message: 'chore: api-platform ${{ inputs.tag }}'
branch: api-platform-core
title: 'chore: api-platform ${{ inputs.tag }}'
token: ${{ secrets.RELEASE_TOKEN }}
body: 'Updates api-platform/core to ${{ inputs.tag }}'
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/.env
/helm/api-platform/charts/*
!/helm/api-platform/charts/.gitignore
/api-platform
43 changes: 43 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
version: 2

builds:
- main: ./cmd/api-platform
binary: api-platform
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
ldflags:
- -s -w -X github.com/api-platform/api-platform/cmd/cli.version={{.Version}}

archives:
- format: tar.gz
name_template: "api-platform_{{ .Os }}_{{ .Arch }}"
format_overrides:
- goos: windows
format: zip

brews:
- repository:
owner: api-platform
name: homebrew-tap
name: api-platform
homepage: https://api-platform.com
description: Scaffold and manage API Platform projects
license: MIT

checksum:
name_template: checksums.txt

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- "^ci:"
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.PHONY: build install clean

build:
go build -ldflags "-s -w" -o api-platform ./cmd/api-platform

install:
go install -ldflags "-s -w" ./cmd/api-platform

clean:
rm -f api-platform
Loading