mirror of
https://github.com/symfony/recipes-contrib.git
synced 2026-09-17 18:16:46 +03:00
Merge branch 'create-project'
* create-project: Move create-project from travis to gha
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
name: Q&A
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
|
||||
create-project:
|
||||
name: Create-project
|
||||
runs-on: Ubuntu-20.04
|
||||
|
||||
steps:
|
||||
-
|
||||
name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
coverage: "none"
|
||||
php-version: "8.0"
|
||||
|
||||
-
|
||||
name: Export configuration
|
||||
continue-on-error: true
|
||||
id: config
|
||||
run: |
|
||||
SYMFONY_ENDPOINT=https://flex.symfony.com/r/github.com/symfony/recipes-contrib/${{ github.event.number }}
|
||||
echo SYMFONY_ENDPOINT=$SYMFONY_ENDPOINT >> $GITHUB_ENV
|
||||
|
||||
PACKAGES=$(curl -s $SYMFONY_ENDPOINT | sed -En 's/.*composer req "([^"]+)".*/\1/p')
|
||||
echo PACKAGES=$PACKAGES >> $GITHUB_ENV
|
||||
|
||||
[[ "" != "$PACKAGES" ]]
|
||||
|
||||
-
|
||||
name: Create-project with skeleton ^4
|
||||
if: "always() && steps.config.outcome == 'success'"
|
||||
run: |
|
||||
composer create-project --ansi "symfony/skeleton:^4" v4
|
||||
cd v4
|
||||
composer config extra.symfony.allow-contrib true
|
||||
composer require --ansi --ignore-platform-reqs $PACKAGES
|
||||
EXIT_CODE=$?
|
||||
|
||||
if [[ EXIT_CODE -eq 2 ]]; then
|
||||
echo -e "\n#\n#\n# You can ignore this error if your package does not support Symfony 4\n#\n#\n#\n"
|
||||
fi
|
||||
|
||||
exit $EXIT_CODE
|
||||
|
||||
-
|
||||
name: Create-project with skeleton ^5
|
||||
if: "always() && steps.config.outcome == 'success'"
|
||||
run: |
|
||||
composer create-project --ansi "symfony/skeleton:^5" v5
|
||||
cd v5
|
||||
composer config extra.symfony.allow-contrib true
|
||||
composer require --ansi --ignore-platform-reqs $PACKAGES
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
wget -q -O recipes-checker.zip https://codeload.github.com/symfony-tools/recipes-checker/zip/refs/heads/main
|
||||
unzip recipes-checker.zip
|
||||
cd recipes-checker-main
|
||||
composer install --no-dev
|
||||
composer install --ansi --no-dev
|
||||
|
||||
-
|
||||
name: Check manifest.json files
|
||||
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
language: php
|
||||
sudo: false
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.composer/cache/files
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
- php: 8.0
|
||||
env: SKELETON_VERSION="^4.4"
|
||||
- php: 8.0
|
||||
env: SKELETON_VERSION="^5.0"
|
||||
|
||||
before_install:
|
||||
- phpenv config-rm xdebug.ini || true
|
||||
- export SYMFONY_ENDPOINT=https://flex.symfony.com/r/github.com/symfony/recipes-contrib/${TRAVIS_PULL_REQUEST}
|
||||
- export PACKAGES=$(curl -s $SYMFONY_ENDPOINT | sed -En 's/.*composer req "([^"]+)".*/\1/p')
|
||||
- echo "$PACKAGES"
|
||||
|
||||
install:
|
||||
- composer create-project "symfony/skeleton:${SKELETON_VERSION}" flex
|
||||
- cd flex
|
||||
- composer config extra.symfony.allow-contrib true
|
||||
|
||||
before_script:
|
||||
- |
|
||||
install_package() {
|
||||
composer require --ignore-platform-reqs $@;
|
||||
EXIT_CODE=$?;
|
||||
|
||||
MESSAGE="";
|
||||
if [[ EXIT_CODE -eq 0 ]]; then
|
||||
exit 0;
|
||||
elif [[ EXIT_CODE -eq 1 ]]; then
|
||||
MESSAGE="Could not install package and configure package.";
|
||||
elif [[ EXIT_CODE -eq 2 ]]; then
|
||||
MESSAGE="Could not resolve dependencies.\n# You can ignore this error if your package does not support Symfony $SKELETON_VERSION";
|
||||
fi
|
||||
|
||||
echo -e "\n#\n#\n# $MESSAGE\n#\n#\n#\n";
|
||||
exit $EXIT_CODE;
|
||||
}
|
||||
export -f install_package
|
||||
|
||||
script: install_package $(echo $PACKAGES)
|
||||
Reference in New Issue
Block a user