Skip to content

Commit

Permalink
ci(Recipe): update workflows for recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
etienne-monsieurbiz committed Jul 3, 2024
1 parent 354ecfb commit 47e1e46
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 124 deletions.
61 changes: 18 additions & 43 deletions .github/workflows/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,28 @@ jobs:

recipe:

runs-on: ubuntu-latest

env:
SYMFONY_ENDPOINT: http://127.0.0.1/
name: Flex recipe (PHP ${{ matrix.php }}, Sylius ${{ matrix.sylius }})

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['7.4' ,'8.0', '8.1']
sylius: ["~1.9.0", "~1.10.0", "~1.11.0", "~1.12.0"]
php: ['8.0', '8.1', '8.2']
sylius: ['~1.11.0', '~1.12.0']
include:
- php: '8.1'
sylius: '~1.12.0'
sylius_paypal: '~1.5.0'
exclude:
- php: 8.1
sylius: "~1.9.0"
- php: 8.0
sylius: "~1.9.0"
- php: 7.4
sylius: "~1.11.0"
- php: 7.4
sylius: "~1.12.0"
- php: '8.1'
sylius: '~1.12.0'
sylius_paypal: '~1.5.0'
- php: '8.2'
sylius: '~1.12.0'
sylius_paypal: '~1.5.0'


steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: date.timezone=UTC

- name: Set project php-version
run: |
Expand All @@ -48,13 +40,6 @@ jobs:
with:
path: plugin

# Run the server at the start so it can download the recipes!
- name: Run standalone symfony flex server
run: |
echo ${{ github.token }} | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
docker run --rm --name flex -d -v $PWD/plugin/recipes:/var/www/flex/var/repo/private/monsieurbiz/sylius-search-plugin -p 80:80 docker.pkg.github.com/monsieurbiz/docker/symfony-flex-server:latest contrib official
docker ps
- run: mkdir -p /home/runner/{.composer/cache,.config/composer}

- uses: actions/cache@v1
Expand All @@ -64,9 +49,6 @@ jobs:
key: composer2-php:${{ matrix.php }}-sylius:${{ matrix.sylius }}-${{ github.sha }}
restore-keys: composer2-php:${{ matrix.php }}-sylius:${{ matrix.sylius }}-

- name: Update composer
run: sudo composer self-update

- name: Composer Github Auth
run: composer config -g github-oauth.github.com ${{ github.token }}

Expand All @@ -92,20 +74,13 @@ jobs:
working-directory: ./sylius
run: |
composer config --no-plugins allow-plugins true
composer config repositories.plugin '{"type": "path", "url": "../plugin/"}'
composer config extra.symfony.allow-contrib true
composer config secure-http false
composer config --unset platform.php
composer config --no-plugins extra.symfony.allow-contrib true
composer config --no-plugins secure-http false
composer config --no-plugins --unset platform.php
composer config --no-plugins extra.symfony.docker false
composer config --no-plugins --json extra.symfony.endpoint '["https://api.github.com/repos/monsieurbiz/symfony-recipes/contents/index.json?ref=flex/master","flex://defaults"]'
- name: Require plugin without install
- name: Require plugin & install all dependencies
working-directory: ./sylius
run: |
composer require --no-install --no-scripts monsieurbiz/sylius-search-plugin="*@dev"
- name: Composer install
working-directory: ./sylius
run: |
composer install
- name: Show flex server logs
run: docker logs --tail 100 flex
composer require monsieurbiz/sylius-search-plugin="*@dev"
4 changes: 2 additions & 2 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ jobs:

security:

name: Security check (PHP ${{ matrix.php }})
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1']
php: [ '8.0', '8.1', '8.2' ]

steps:
- uses: actions/checkout@v2
Expand All @@ -24,7 +25,6 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: date.timezone=UTC

- name: Set project php-version
run: |
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ on:
jobs:

php:

name: Quality tests (PHP ${{ matrix.php }})
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: ['8.0', '8.1']
php: [ '8.0', '8.1', '8.2' ]

env:
SYMFONY_ARGS: --no-tls
Expand All @@ -25,13 +25,12 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '16'

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: date.timezone=UTC

- name: Set project php-version
run: |
Expand All @@ -51,9 +50,6 @@ jobs:

- run: mkdir -p /home/runner/{.composer/cache,.config/composer}

- name: Update composer
run: sudo composer self-update

- name: Composer Github Auth
run: composer config -g github-oauth.github.com ${{ github.token }}

Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ SYMFONY=cd ${APP_DIR} && symfony
COMPOSER=symfony composer
CONSOLE=${SYMFONY} console
export COMPOSE_PROJECT_NAME=search
export MIGRATIONS_NAMESPACE=MonsieurBiz\\SyliusSearchPlugin\\Migrations
export USER_UID=$(shell id -u)
PLUGIN_NAME=sylius-${COMPOSE_PROJECT_NAME}-plugin
COMPOSE=docker-compose
Expand Down Expand Up @@ -140,7 +141,7 @@ test.container: ## Lint the symfony container
${CONSOLE} lint:container

test.yaml: ## Lint the symfony Yaml files
${CONSOLE} lint:yaml ../../recipes ../../src/Resources/config --parse-tags
${CONSOLE} lint:yaml ../../src/Resources/config

test.schema: ## Validate MySQL Schema
${CONSOLE} doctrine:schema:validate
Expand Down Expand Up @@ -215,7 +216,7 @@ consume.reindex: ## Consume reindex messages during 10min
${CONSOLE} messenger:consume async_search --time-limit=600 -vv

doctrine.diff: ## Doctrine diff
${CONSOLE} doctrine:migration:diff
${CONSOLE} doctrine:migration:diff --namespace="${MIGRATIONS_NAMESPACE}"

doctrine.migrate: ## Doctrine diff
${CONSOLE} doctrine:migration:migrate
Expand Down
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@
},
"extra": {
"symfony": {
"require": "^4.4"
"require": "^4.4",
"docker": false,
"endpoint": [
"https://api.github.com/repos/monsieurbiz/symfony-recipes/contents/index.json?ref=flex/master",
"flex://defaults"
]
},
"branch-alias": {
"dev-master": "2.0-dev"
Expand Down
24 changes: 0 additions & 24 deletions recipes/1.0/config/packages/monsieurbiz_sylius_search_plugin.yaml

This file was deleted.

This file was deleted.

17 changes: 0 additions & 17 deletions recipes/1.0/manifest.json

This file was deleted.

This file was deleted.

This file was deleted.

22 changes: 0 additions & 22 deletions recipes/2.0/manifest.json

This file was deleted.

0 comments on commit 47e1e46

Please sign in to comment.