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
124 changes: 62 additions & 62 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
# name: CI
name: CI

# on:
# push:
# branches:
# - deploy-v3
# pull_request: ~
# workflow_dispatch: ~
on:
push:
branches:
- deploy-v3
pull_request: ~
workflow_dispatch: ~

# concurrency:
# group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
# cancel-in-progress: true
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

# jobs:
# tests:
# name: Tests
# runs-on: ubuntu-latest
# permissions:
# contents: 'read'
# id-token: 'write'
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - name: Pull images
# run: docker compose pull --ignore-pull-failures || true
# - name: Start services
# run: docker compose up --build -d
# - name: Wait for services
# run: |
# while status="$(docker inspect --format="{{if .Config.Healthcheck}}{{print .State.Health.Status}}{{end}}" "$(docker compose ps -q php)")"; do
# case $status in
# starting) sleep 1;;
# healthy) exit 0;;
# unhealthy)
# docker compose ps
# docker compose logs
# exit 1
# ;;
# esac
# done
# exit 1
# - name: Check HTTP reachability
# run: curl -v -o /dev/null http://localhost
# - name: Check API reachability
# run: curl -vk -o /dev/null https://localhost
# - name: Check PWA reachability
# run: "curl -vk -o /dev/null -H 'Accept: text/html' https://localhost"
# - name: Create test database
# run: |
# docker compose exec -T php bin/console -e test doctrine:database:create
# docker compose exec -T php bin/console -e test doctrine:migrations:migrate --no-interaction
# - name: PHPUnit
# run: docker compose exec -T php bin/phpunit
# - name: Doctrine Schema Validator
# run: docker compose exec -T php bin/console doctrine:schema:validate
# - name: Psalm
# run: docker compose exec -T php vendor/bin/psalm
# # gcloud does not work with Python 3.10 because collections. Mappings were removed in Python 3.10.
# - uses: actions/setup-python@v4
# with:
# python-version: 3.9.15
# - name: Setup gcloud
# uses: google-github-actions/setup-gcloud@v1
# - name: Lint Helm
# run: helm lint ./helm/api-platform/
jobs:
tests:
name: Tests
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
env:
GITHUB_KEY: ${{ secrets.GH_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Pull images
run: docker compose pull --ignore-pull-failures || true
- name: Start services
run: docker compose up --build -d
- name: Wait for services
run: |
while status="$(docker inspect --format="{{if .Config.Healthcheck}}{{print .State.Health.Status}}{{end}}" "$(docker compose ps -q php)")"; do
case $status in
starting) sleep 1;;
healthy) exit 0;;
unhealthy)
docker compose ps
docker compose logs
exit 1
;;
esac
done
exit 1
- name: Check HTTP reachability
run: curl -v -o /dev/null http://localhost
- name: Check API reachability
run: curl -vk -o /dev/null https://localhost
- name: Check PWA reachability
run: "curl -vk -o /dev/null -H 'Accept: text/html' https://localhost"
- name: Create test database
run: |
docker compose exec -T php bin/console -e test doctrine:database:create
docker compose exec -T php bin/console -e test doctrine:migrations:migrate --no-interaction
- name: PHPUnit
run: docker compose exec -T php bin/phpunit
- name: Doctrine Schema Validator
run: docker compose exec -T php bin/console doctrine:schema:validate
# gcloud does not work with Python 3.10 because collections. Mappings were removed in Python 3.10.
- uses: actions/setup-python@v4
with:
python-version: 3.9.15
- name: Setup gcloud
uses: google-github-actions/setup-gcloud@v1
- name: Lint Helm
run: helm lint ./helm/api-platform/
2 changes: 1 addition & 1 deletion api/src/Entity/Greeting.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* This is a dummy entity. Remove it!
*/
#[ApiResource(mercure: true)]
#[ApiResource]
#[ORM\Entity]
class Greeting
{
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ volumes:

secrets:
GITHUB_KEY:
file: ./secret_github_key
environment: GITHUB_KEY
Loading