From 0de5a7de3a8854a3afe4d37d09b3deaac8223d0e Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 18 Oct 2021 15:51:06 +0200 Subject: [PATCH 01/12] Add reusable workflows --- .github/workflows/callable-flex-cleanup.yml | 19 ++ .github/workflows/callable-flex-update.yml | 51 ++++ .github/workflows/callable-qa.yml | 273 ++++++++++++++++++++ 3 files changed, 343 insertions(+) create mode 100644 .github/workflows/callable-flex-cleanup.yml create mode 100644 .github/workflows/callable-flex-update.yml create mode 100644 .github/workflows/callable-qa.yml diff --git a/.github/workflows/callable-flex-cleanup.yml b/.github/workflows/callable-flex-cleanup.yml new file mode 100644 index 00000000..2f104d3d --- /dev/null +++ b/.github/workflows/callable-flex-cleanup.yml @@ -0,0 +1,19 @@ +name: Cleanup Flex testing endpoint + +on: + workflow_call: + +jobs: + flex-cleanup: + name: Cleanup Flex testing endpoint + runs-on: Ubuntu-20.04 + + steps: + - + name: Checkout + uses: actions/checkout@v2 + + - + name: Cleanup Flex testing endpoint + run: | + git push origin :flex/pull-${{ github.event.number }} || true diff --git a/.github/workflows/callable-flex-update.yml b/.github/workflows/callable-flex-update.yml new file mode 100644 index 00000000..79129af3 --- /dev/null +++ b/.github/workflows/callable-flex-update.yml @@ -0,0 +1,51 @@ +name: Update Flex endpoint + +on: + workflow_call: + inputs: + branch: + default: main + required: false + type: string + contrib: + required: false + type: boolean + versions_json: + required: false + type: string + +jobs: + flex-update: + name: Update Flex endpoint + runs-on: Ubuntu-20.04 + + steps: + - + name: Checkout + uses: actions/checkout@v2 + id: checkout + with: + fetch-depth: 0 + + - + name: Install tools + run: | + git config --global user.email "" + git config --global user.name "github-action[bot]" + cd .github + 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 --ansi --no-dev + + - + name: Update Flex endpoint + run: | + mkdir .github/flex-endpoint + git ls-tree HEAD */*/* | php .github/recipes-checker-main/run generate:flex-endpoint ${{ github.repository }} ${{ inputs.branch }} flex/main .github/flex-endpoint ${{ inputs.versions_json }} ${{ inputs.contrib && '--contrib' || '' }} + git switch flex/main + git rm -q *.json + mv .github/flex-endpoint/*.json . + git add *.json + git commit -m 'Update Flex endpoint' || true + git push origin -f flex/main diff --git a/.github/workflows/callable-qa.yml b/.github/workflows/callable-qa.yml new file mode 100644 index 00000000..ec79821e --- /dev/null +++ b/.github/workflows/callable-qa.yml @@ -0,0 +1,273 @@ +name: Q&A + +on: + workflow_call: + inputs: + branch: + default: main + required: false + type: string + contrib: + required: false + type: boolean + find_yaml: + required: false + type: string + create_project_php: + default: '7.4' + required: false + type: string + +jobs: + run-checks: + name: Run checks + runs-on: Ubuntu-20.04 + + steps: + - + name: Checkout + uses: actions/checkout@v2 + id: checkout + with: + fetch-depth: 0 + ref: 'refs/pull/${{ github.event.number }}/merge' + + - + name: Install tools + run: | + git config --global user.email "" + git config --global user.name "github-action[bot]" + cd .github + 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 --ansi --no-dev + + - + name: Check manifest.json files + if: "always() && steps.checkout.outcome == 'success'" + run: | + .github/recipes-checker-main/run lint:manifests ${{ inputs.contrib && '--contrib' || '' }} + + - + name: Remove non-patched packages + if: "always() && steps.checkout.outcome == 'success'" + run: | + .github/recipes-checker-main/run list-unpatched-packages $GITHUB_EVENT_PATH ${{ secrets.GITHUB_TOKEN }} | xargs -r -n10 rm -rf + + - + name: Generate Flex testing endpoint + if: "always() && steps.checkout.outcome == 'success' && github.base_ref == inputs.branch" + run: | + mkdir .github/flex-endpoint + git ls-tree HEAD */*/* | php .github/recipes-checker-main/run generate:flex-endpoint ${{ github.repository }} ${{ inputs.branch }} flex/pull-${{ github.event.number }} .github/flex-endpoint ${{ inputs.contrib && '--contrib' || '' }} + git stash + git switch -c pr + git switch --orphan flex/pull-${{ github.event.number }} + git reset --hard -q + mv .github/flex-endpoint/*.json . + git add *.json + git commit -m 'Create Flex endpoint' || true + git push origin -f flex/pull-${{ github.event.number }} + git switch pr + git stash pop -q + + - + name: Compute diff between recipe versions + if: "always() && steps.checkout.outcome == 'success'" + run: | + find * -mindepth 1 -maxdepth 1 -type d | sort \ + | .github/recipes-checker-main/run diff-recipe-versions 'https://api.github.com/repos/${{ github.repository }}/contents/index.json?ref=flex/pull-${{ github.event.number }}' \ + > .github/diff-recipe-versions.md + + - + name: Post diff between recipe versions + if: "always() && steps.checkout.outcome == 'success'" + uses: marocchino/sticky-pull-request-comment@v2 + with: + path: .github/diff-recipe-versions.md + + - + name: No symlinks + if: "always() && steps.checkout.outcome == 'success'" + run: | + SYMLINKS=$(find * -type l) + + if [[ "" != "$SYMLINKS" ]]; then echo -e "::error::Symlinks are not allowed\nFound $SYMLINKS\n"; exit 1; fi + + - + name: No .yml, use .yaml + if: "always() && steps.checkout.outcome == 'success'" + run: | + YMLS=$(find * -name '*.yml' ${{ inputs.find_yaml }}) + + if [[ "" != "$YMLS" ]]; then echo -e "::error::*.yml files should renamed to *.yaml\nFound $YMLS\n"; exit 1; fi + + - + name: No .gitkeep, use .gitignore + if: "always() && steps.checkout.outcome == 'success'" + run: | + GITKEEPS=$(find * -name .gitkeep) + + if [[ "" != "$GITKEEPS" ]]; then echo -e "::error::.gitkeep files should be renamed to .gitignore\nFound $GITKEEPS\n"; exit 1; fi + + - + name: 4 spaces indentation + if: "always() && steps.checkout.outcome == 'success'" + run: | + ERRORS=$(find * -name '*.yaml' -or -name '*.json' \ + | xargs -n1 grep -P -H -n -v '^(( )*[^ \t]|$)' \ + | cut -d: -f1-2 \ + | sed 's/\(.*\):\([0-9]*\)$/\\n::error file=\1,line=\2::Indendation must be a multiple of 4 spaces/' || true) + + if [[ "" != "$ERRORS" ]]; then echo -e "$ERRORS\n"; exit 1; fi + + - + name: Text files end with a newline + if: "always() && steps.checkout.outcome == 'success'" + run: | + ERRORS=$(find * -name '*.yaml' -or -name '*.yml' -or -name '*.txt' -or -name '*.md' -or -name '*.markdown' \ + -or -name '*.json' -or -name '*.rst' -or -name '*.php' -or -name '*.js' -or -name '*.css' -or -name '*.twig' \ + | xargs -n1 -I{} bash -c '[ -n "$(tail -c1 {})" ] && echo ::error file={},line=$((1 + `wc -l {} | cut -d" " -f1`))::Should end with a newline' || true) + + if [[ "" != "$ERRORS" ]]; then echo -e "$ERRORS\n"; exit 1; fi + + - + name: Use https when referencing symfony.com + if: "always() && steps.checkout.outcome == 'success'" + run: | + ERRORS=$(grep -H -n 'http://.*symfony\.com' * -r \ + | cut -d: -f1-2 \ + | sed 's/\(.*\):\([0-9]*\)$/\\n::error file=\1,line=\2::Use https when referencing symfony.com/' || true) + + if [[ "" != "$ERRORS" ]]; then echo -e "$ERRORS\n"; exit 1; fi + + - + name: manifest.json is found + if: "always() && steps.checkout.outcome == 'success'" + run: | + MISSING=$(find * -mindepth 2 -maxdepth 2 -type d '!' -exec test -f '{}/manifest.json' ';' -print) + + if [[ "" != "$MISSING" ]]; then echo -e "::error::Recipes must define a \"manifest.json\" file\nFile not found in $MISSING\n"; exit 1; fi + + - + name: JSON files are valid + if: "always() && steps.checkout.outcome == 'success'" + run: | + ERRORS=$(find * -name '*.json' | parallel -j+3 -i{} -n1 bash -c 'ERR=$(python -mjson.tool {} 2>&1 1> /dev/null) || echo \\n::error file={},line=`echo "${ERR#*: line }" | cut -d" " -f 1`::${ERR%%: line *}') + + if [[ "" != "$ERRORS" ]]; then echo -e "$ERRORS\n"; exit 1; fi + + - + name: YAML files are valid + if: "always() && steps.checkout.outcome == 'success'" + run: | + find * -name '*.yaml' -or -name '*.yml' | .github/recipes-checker-main/run lint:yaml + + - + name: Packages exist on packagist.org + if: "always() && steps.checkout.outcome == 'success'" + run: | + .github/recipes-checker-main/run lint:packages + + - + name: Contribution is under MIT and has no merge commits + if: "always() && steps.checkout.outcome == 'success'" + run: | + .github/recipes-checker-main/run lint:pull-request $GITHUB_EVENT_PATH ${{ secrets.GITHUB_TOKEN }} + + - + name: Parameters should be defined via the "container" configurator + if: "always() && steps.checkout.outcome == 'success'" + run: | + ERRORS=$(find */*/*/config/packages/ -name '*.yaml' -or -name '*.yml' \ + | xargs -n1 grep -P -H -n '^parameters:' \ + | cut -d: -f1-2 \ + | sed 's/\(.*\):\([0-9]*\)$/\\n::error file=\1,line=\2::"parameters" should be defined via the "container" configurator instead/' || true) + + if [[ "" != "$ERRORS" ]]; then echo -e "$ERRORS\n"; exit 1; fi + + - + name: Underscore notation under config/ + if: "always() && steps.checkout.outcome == 'success'" + run: | + ERRORS=$(find */*/*/config -type f \ + | grep -v -P '[^/]+/[^/]+/[^/]+/config/[0-9a-z_./]+$' \ + | xargs -n1 -I{} echo "::error file={}::Underscore notation is required for file and directory names under config/" || true) + + if [[ "" != "$ERRORS" ]]; then echo -e "$ERRORS\n"; exit 1; fi + + - + name: Yaml nulls should not be "~" + if: "always() && steps.checkout.outcome == 'success'" + run: | + ERRORS=$(find * -name '*.yaml' -or -name '*.yml' \ + | xargs -n1 grep -F -H -n ': ~'\ + | cut -d: -f1-2 \ + | sed 's/\(.*\):\([0-9]*\)$/\\n::error file=\1,line=\2::"~" should be replaced with "null"/' || true) + + if [[ "" != "$ERRORS" ]]; then echo -e "$ERRORS\n"; exit 1; fi + + - + name: Symfony commands should not be wrapped in a Makefile + if: "always() && steps.checkout.outcome == 'success'" + run: | + ERRORS=$(find * -name Makefile \ + | xargs -n1 grep -P -H -n 'bin/console|\$\(CONSOLE\)' \ + | cut -d: -f1-2 \ + | 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: run-checks + name: Run updated recipes + runs-on: Ubuntu-20.04 + + steps: + - + name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + coverage: "none" + php-version: "${{ inputs.create_project_php }}" + + - + 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 ${{ inputs.contrib && 'true' || 'false' }} + composer config minimum-stability dev + export SYMFONY_ENDPOINT=https://api.github.com/repos/${{ github.repository }}/contents/index.json?ref=flex/pull-${{ github.event.number }} + composer require -W --ansi $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 ${{ inputs.contrib && 'true' || 'false' }} + composer config minimum-stability dev + export SYMFONY_ENDPOINT=https://api.github.com/repos/${{ github.repository }}/contents/index.json?ref=flex/pull-${{ github.event.number }} + composer require -W --ansi $PACKAGES From 2120e69b2e22dd66f9c4f05894f3df41270b69a1 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Fri, 17 Dec 2021 09:35:46 -0500 Subject: [PATCH 02/12] Copying the "archived/" directory from recipes-checker --- .github/workflows/callable-flex-update.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/callable-flex-update.yml b/.github/workflows/callable-flex-update.yml index 79129af3..cb0159bb 100644 --- a/.github/workflows/callable-flex-update.yml +++ b/.github/workflows/callable-flex-update.yml @@ -47,5 +47,7 @@ jobs: git rm -q *.json mv .github/flex-endpoint/*.json . git add *.json + cp -a .github/flex-endpoint/archived . + git add archived/ git commit -m 'Update Flex endpoint' || true git push origin -f flex/main From 93265b3b7e0a0c900b70f1cb51c5023a4d2baa1c Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Fri, 17 Dec 2021 12:35:43 -0500 Subject: [PATCH 03/12] Add callable action to repopulate the recipe archives --- .../callable-flex-update-archived.yml | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/callable-flex-update-archived.yml diff --git a/.github/workflows/callable-flex-update-archived.yml b/.github/workflows/callable-flex-update-archived.yml new file mode 100644 index 00000000..c0fa3e04 --- /dev/null +++ b/.github/workflows/callable-flex-update-archived.yml @@ -0,0 +1,46 @@ +name: Update Flex Archives + +on: + workflow_call: + inputs: + branch: + default: master + required: false + type: string + +jobs: + flex-update-archived: + name: Update Flex Archives + runs-on: Ubuntu-20.04 + + steps: + - + name: Checkout + uses: actions/checkout@v2 + id: checkout + with: + fetch-depth: 0 + + - + name: Install tools + run: | + git config --global user.email "" + git config --global user.name "github-action[bot]" + cd .github + 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 --ansi --no-dev + - + name: Update Flex Archives + run: | + git switch ${{ inputs.branch }} + + mkdir .github/archived + php .github/recipes-checker-main/run generate:archived-recipes . ${{ inputs.branch }} .github/archived + + git switch flex/main + cp -a .github/archived . + git add archived/ + git commit -m 'Update Flex archives' || true + git push origin -f flex/main From 8130145858802557df0633c4e940e46a4695796b Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 23 Nov 2021 11:09:41 +0100 Subject: [PATCH 04/12] Hit raw.githubusercontent.com to work around rate limiting --- .github/workflows/callable-qa.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/callable-qa.yml b/.github/workflows/callable-qa.yml index ec79821e..39afe25b 100644 --- a/.github/workflows/callable-qa.yml +++ b/.github/workflows/callable-qa.yml @@ -77,7 +77,7 @@ jobs: if: "always() && steps.checkout.outcome == 'success'" run: | find * -mindepth 1 -maxdepth 1 -type d | sort \ - | .github/recipes-checker-main/run diff-recipe-versions 'https://api.github.com/repos/${{ github.repository }}/contents/index.json?ref=flex/pull-${{ github.event.number }}' \ + | .github/recipes-checker-main/run diff-recipe-versions 'https://raw.githubusercontent.com/${{ github.repository }}/flex/pull-${{ github.event.number }}/index.json' \ > .github/diff-recipe-versions.md - @@ -250,7 +250,7 @@ jobs: cd v4 composer config extra.symfony.allow-contrib ${{ inputs.contrib && 'true' || 'false' }} composer config minimum-stability dev - export SYMFONY_ENDPOINT=https://api.github.com/repos/${{ github.repository }}/contents/index.json?ref=flex/pull-${{ github.event.number }} + export SYMFONY_ENDPOINT=https://raw.githubusercontent.com/${{ github.repository }}/flex/pull-${{ github.event.number }}/index.json composer require -W --ansi $PACKAGES EXIT_CODE=$? @@ -269,5 +269,5 @@ jobs: cd v5 composer config extra.symfony.allow-contrib ${{ inputs.contrib && 'true' || 'false' }} composer config minimum-stability dev - export SYMFONY_ENDPOINT=https://api.github.com/repos/${{ github.repository }}/contents/index.json?ref=flex/pull-${{ github.event.number }} + export SYMFONY_ENDPOINT=https://raw.githubusercontent.com/${{ github.repository }}/flex/pull-${{ github.event.number }}/index.json composer require -W --ansi $PACKAGES From a24eb2a5cb5dd40fd31763ce334c4cb1ecc60a85 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sun, 13 Feb 2022 14:56:57 +0100 Subject: [PATCH 05/12] Fix linting JSON files --- .github/workflows/callable-qa.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/callable-qa.yml b/.github/workflows/callable-qa.yml index 39afe25b..74952ce2 100644 --- a/.github/workflows/callable-qa.yml +++ b/.github/workflows/callable-qa.yml @@ -154,7 +154,7 @@ jobs: name: JSON files are valid if: "always() && steps.checkout.outcome == 'success'" run: | - ERRORS=$(find * -name '*.json' | parallel -j+3 -i{} -n1 bash -c 'ERR=$(python -mjson.tool {} 2>&1 1> /dev/null) || echo \\n::error file={},line=`echo "${ERR#*: line }" | cut -d" " -f 1`::${ERR%%: line *}') + ERRORS=$(find * -name '*.json' | xargs -I{} -n1 -P0 bash -c 'ERR=$(cd / && python -mjson.tool '$(pwd)'/{} 2>&1 1> /dev/null) || echo \\n::error file={},line=`echo "${ERR#*: line }" | cut -d" " -f 1`::${ERR%%: line *}') if [[ "" != "$ERRORS" ]]; then echo -e "$ERRORS\n"; exit 1; fi From 7a02acd12dc4a5edfc1606a105e4f03e646a7dc5 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 14 Feb 2022 13:30:02 +0100 Subject: [PATCH 06/12] Fix escaping args in commands --- .github/workflows/callable-qa.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/callable-qa.yml b/.github/workflows/callable-qa.yml index 74952ce2..27090dee 100644 --- a/.github/workflows/callable-qa.yml +++ b/.github/workflows/callable-qa.yml @@ -128,7 +128,7 @@ jobs: run: | ERRORS=$(find * -name '*.yaml' -or -name '*.yml' -or -name '*.txt' -or -name '*.md' -or -name '*.markdown' \ -or -name '*.json' -or -name '*.rst' -or -name '*.php' -or -name '*.js' -or -name '*.css' -or -name '*.twig' \ - | xargs -n1 -I{} bash -c '[ -n "$(tail -c1 {})" ] && echo ::error file={},line=$((1 + `wc -l {} | cut -d" " -f1`))::Should end with a newline' || true) + | xargs -n1 -P0 bash -c '[ -n "$(tail -c1 "$0")" ] && echo ::error file="$0",line=$((1 + `wc -l "$0" | cut -d" " -f1`))::Should end with a newline' || true) if [[ "" != "$ERRORS" ]]; then echo -e "$ERRORS\n"; exit 1; fi @@ -154,7 +154,7 @@ jobs: name: JSON files are valid if: "always() && steps.checkout.outcome == 'success'" run: | - ERRORS=$(find * -name '*.json' | xargs -I{} -n1 -P0 bash -c 'ERR=$(cd / && python -mjson.tool '$(pwd)'/{} 2>&1 1> /dev/null) || echo \\n::error file={},line=`echo "${ERR#*: line }" | cut -d" " -f 1`::${ERR%%: line *}') + ERRORS=$(find * -name '*.json' | xargs -n1 -P0 bash -c 'ERR=$(cd / && python -mjson.tool '$(pwd)'/"$0" 2>&1 1> /dev/null) || echo \\n::error file="$0",line=`echo "${ERR#*: line }" | cut -d" " -f 1`::${ERR%%: line *}') if [[ "" != "$ERRORS" ]]; then echo -e "$ERRORS\n"; exit 1; fi From 72b3ddae9d502fc6fc79004174d04703ffd734b9 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 15 Feb 2022 11:08:58 +0100 Subject: [PATCH 07/12] Test recipes on Symfony 5&6 --- .github/workflows/callable-qa.yml | 38 +++++++++++++++++++------------ 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/.github/workflows/callable-qa.yml b/.github/workflows/callable-qa.yml index 27090dee..114bb8fa 100644 --- a/.github/workflows/callable-qa.yml +++ b/.github/workflows/callable-qa.yml @@ -14,7 +14,6 @@ on: required: false type: string create_project_php: - default: '7.4' required: false type: string @@ -225,13 +224,6 @@ jobs: runs-on: Ubuntu-20.04 steps: - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - coverage: "none" - php-version: "${{ inputs.create_project_php }}" - - name: Export configuration continue-on-error: true @@ -242,12 +234,20 @@ jobs: [[ "" != "$PACKAGES" ]] - - name: Create-project with skeleton ^4 + name: Setup PHP 7.4 + uses: shivammathur/setup-php@v2 + with: + coverage: "none" + php-version: "7.4" + + - + name: Create-project with skeleton ^5 if: "always() && steps.config.outcome == 'success'" run: | set -x - composer create-project --ansi "symfony/skeleton:^4" v4 - cd v4 + php -v + composer create-project --ansi "symfony/skeleton:^5" v5 + cd v5 composer config extra.symfony.allow-contrib ${{ inputs.contrib && 'true' || 'false' }} composer config minimum-stability dev export SYMFONY_ENDPOINT=https://raw.githubusercontent.com/${{ github.repository }}/flex/pull-${{ github.event.number }}/index.json @@ -255,18 +255,26 @@ jobs: 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" + echo -e "\n#\n#\n# You can ignore this error if your package does not support Symfony 5\n#\n#\n#\n" fi exit $EXIT_CODE - - name: Create-project with skeleton ^5 + name: Setup PHP 8.1 + uses: shivammathur/setup-php@v2 + with: + coverage: "none" + php-version: "8.1" + + - + name: Create-project with skeleton ^6 if: "always() && steps.config.outcome == 'success'" run: | set -x - composer create-project --ansi "symfony/skeleton:^5" v5 - cd v5 + php -v + composer create-project --ansi "symfony/skeleton:^6" v6 + cd v6 composer config extra.symfony.allow-contrib ${{ inputs.contrib && 'true' || 'false' }} composer config minimum-stability dev export SYMFONY_ENDPOINT=https://raw.githubusercontent.com/${{ github.repository }}/flex/pull-${{ github.event.number }}/index.json From ce4b08db387dd4499a43f0572c8cbf26bb433bf8 Mon Sep 17 00:00:00 2001 From: Ilya Antipenko <1021703+aivus@users.noreply.github.com> Date: Fri, 26 Nov 2021 16:56:53 +0100 Subject: [PATCH 08/12] Specify license for recipes-checker-main lint:pull-request --- .github/workflows/callable-qa.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/callable-qa.yml b/.github/workflows/callable-qa.yml index 114bb8fa..c99746bb 100644 --- a/.github/workflows/callable-qa.yml +++ b/.github/workflows/callable-qa.yml @@ -173,7 +173,7 @@ jobs: name: Contribution is under MIT and has no merge commits if: "always() && steps.checkout.outcome == 'success'" run: | - .github/recipes-checker-main/run lint:pull-request $GITHUB_EVENT_PATH ${{ secrets.GITHUB_TOKEN }} + .github/recipes-checker-main/run lint:pull-request --license=MIT $GITHUB_EVENT_PATH ${{ secrets.GITHUB_TOKEN }} - name: Parameters should be defined via the "container" configurator From f2349cee1811aaadb45586bf7ce3e724ce9b81b1 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 15 Feb 2022 16:45:40 +0100 Subject: [PATCH 09/12] Enable Automerge --- .github/workflows/callable-qa.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/callable-qa.yml b/.github/workflows/callable-qa.yml index c99746bb..76e04ac5 100644 --- a/.github/workflows/callable-qa.yml +++ b/.github/workflows/callable-qa.yml @@ -71,6 +71,13 @@ jobs: git switch pr git stash pop -q + - + name: Enable Automerge + if: "always() && steps.checkout.outcome == 'success'" + run: gh pr merge --auto --squash ${{ github.event.number }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Compute diff between recipe versions if: "always() && steps.checkout.outcome == 'success'" From 07cc58ffd13fe05406b7dd23b9e5034c6dfd82fa Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sat, 19 Feb 2022 11:42:24 +0100 Subject: [PATCH 10/12] Clean CI config --- .github/workflows/callable-qa.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/callable-qa.yml b/.github/workflows/callable-qa.yml index 76e04ac5..eaf44db5 100644 --- a/.github/workflows/callable-qa.yml +++ b/.github/workflows/callable-qa.yml @@ -13,9 +13,6 @@ on: find_yaml: required: false type: string - create_project_php: - required: false - type: string jobs: run-checks: From e4e77c5dec40bbb8cb574a386996fc97073d9aec Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sat, 19 Feb 2022 11:43:56 +0100 Subject: [PATCH 11/12] Always run "Setup PHP" steps --- .github/workflows/callable-qa.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/callable-qa.yml b/.github/workflows/callable-qa.yml index eaf44db5..e11d220b 100644 --- a/.github/workflows/callable-qa.yml +++ b/.github/workflows/callable-qa.yml @@ -239,6 +239,7 @@ jobs: - name: Setup PHP 7.4 + if: "always() && steps.config.outcome == 'success'" uses: shivammathur/setup-php@v2 with: coverage: "none" @@ -266,6 +267,7 @@ jobs: - name: Setup PHP 8.1 + if: "always() && steps.config.outcome == 'success'" uses: shivammathur/setup-php@v2 with: coverage: "none" From 844d33f7866c41eb0d9e50f3ea3626ec64d564cd Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Tue, 26 Apr 2022 13:54:08 -0400 Subject: [PATCH 12/12] Adding a new callable recipes readme GH action --- .../callable-recipe-readme-update.yml | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/callable-recipe-readme-update.yml diff --git a/.github/workflows/callable-recipe-readme-update.yml b/.github/workflows/callable-recipe-readme-update.yml new file mode 100644 index 00000000..99c531ab --- /dev/null +++ b/.github/workflows/callable-recipe-readme-update.yml @@ -0,0 +1,48 @@ +name: Update RECIPES.md + +on: + workflow_call: + inputs: + # branch where the RECIPES.md will be committed + branch: + required: true + type: string + contrib: + required: false + type: boolean + +jobs: + call-recipe-readme-update: + name: Update RECIPES.md + runs-on: Ubuntu-20.04 + + steps: + - + name: Checkout + uses: actions/checkout@v2 + id: checkout + with: + fetch-depth: 0 + + - + name: Install tools + run: | + git config --global user.email "" + git config --global user.name "github-action[bot]" + cd .github + 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 --ansi --no-dev + + - + name: Generate Recipes README + run: | + mkdir .github/recipe-readme + git switch flex/main + php .github/recipes-checker-main/run generate:recipes-readme index.json ${{ inputs.contrib && '--contrib' || '' }} > .github/recipe-readme/RECIPES.md + git switch ${{ inputs.branch }} + cp .github/recipe-readme/RECIPES.md RECIPES.md + git add RECIPES.md + git commit -m 'Update Recipes README' || true + git push origin ${{ inputs.branch }}