From a4ce6d86720c0f225ce7118c83a8dc7d5bf17cf8 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 23 Sep 2021 12:30:14 +0200 Subject: [PATCH] [GHA] Merge create-project into qa --- .github/workflows/create-project.yml | 64 ---------------------------- .github/workflows/qa.yml | 57 ++++++++++++++++++++++++- 2 files changed, 56 insertions(+), 65 deletions(-) delete mode 100644 .github/workflows/create-project.yml diff --git a/.github/workflows/create-project.yml b/.github/workflows/create-project.yml deleted file mode 100644 index 769e45f8..00000000 --- a/.github/workflows/create-project.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: Run updated recipes - -on: - pull_request: - -defaults: - run: - shell: bash - -jobs: - - create-project: - name: Run updated recipes - 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: | - set -x - composer create-project --ansi "symfony/skeleton:^4" v4 - cd v4 - composer config extra.symfony.allow-contrib true - composer config minimum-stability dev - 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: | - set -x - composer create-project --ansi "symfony/skeleton:^5" v5 - cd v5 - composer config extra.symfony.allow-contrib true - composer config minimum-stability dev - composer require --ansi --ignore-platform-reqs $PACKAGES diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml index 9b7f0abe..0dcb4635 100644 --- a/.github/workflows/qa.yml +++ b/.github/workflows/qa.yml @@ -1,4 +1,4 @@ -name: Run checks +name: Q&A on: pull_request_target: @@ -208,3 +208,58 @@ jobs: | sed 's/\(.*\):\([0-9]*\)$/\\n::error file=\1,line=\2::Symfony commands should not be wrapped in a Makefile/' || true) if [[ "" != "$ERRORS" ]]; then echo -e "$ERRORS\n"; exit 1; fi + + create-project: + needs: tests + name: Run updated recipes + 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: | + PACKAGES=$(curl -s https://raw.githubusercontent.com/${{ github.repository }}/flex/pull-${{ github.event.number }}/index.json | jq -r '.recipes | to_entries | map(.key+":^"+.value[-1]) | join(" ")') + echo PACKAGES=$PACKAGES >> $GITHUB_ENV + [[ "" != "$PACKAGES" ]] + + - + name: Create-project with skeleton ^4 + if: "always() && steps.config.outcome == 'success'" + run: | + set -x + composer create-project --ansi "symfony/skeleton:^4" v4 + cd v4 + composer config extra.symfony.allow-contrib true + composer config minimum-stability dev + composer require --ansi "symfony/flex:^1.16" + export SYMFONY_ENDPOINT=https://api.github.com/repos/${{ github.repository }}/contents/index.json?ref=flex/pull-${{ github.event.number }} + 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: | + set -x + composer create-project --ansi "symfony/skeleton:^5" v5 + cd v5 + composer config extra.symfony.allow-contrib true + composer config minimum-stability dev + composer require --ansi "symfony/flex:^1.16" + export SYMFONY_ENDPOINT=https://api.github.com/repos/${{ github.repository }}/contents/index.json?ref=flex/pull-${{ github.event.number }} + composer require --ansi --ignore-platform-reqs $PACKAGES