mirror of
https://github.com/symfony/recipes.git
synced 2026-09-11 23:26:27 +03:00
Generate Flex endpoint
This commit is contained in:
@@ -38,6 +38,7 @@ jobs:
|
||||
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 minimum-stability dev
|
||||
@@ -47,6 +48,7 @@ jobs:
|
||||
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 minimum-stability dev
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
name: Flex
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
|
||||
update:
|
||||
name: Update 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 - https://github.com/splitsh/lite/releases/download/v1.0.1/lite_linux_amd64.tar.gz | tar -zxp
|
||||
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: Cache Splitsh-lite
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: .git/splitsh.db
|
||||
key: ${{ runner.os }}-main-${{ github.sha }}
|
||||
restore-keys: ${{ runner.os }}-main-
|
||||
|
||||
-
|
||||
name: Update Flex endpoint
|
||||
run: |
|
||||
find -mindepth 2 -maxdepth 2 -not -wholename './.*' | cut -c 3- | xargs -r -n1 -I{} .github/splitsh-lite --prefix={} --target=refs/heads/flex-main/{} || rm .git/splitsh.db
|
||||
[ -e .git/splitsh.db ] || find -mindepth 2 -maxdepth 2 -not -wholename './.*' | cut -c 3- | xargs -r -n1 -I{} .github/splitsh-lite --prefix={} --target=refs/heads/flex-main/{}
|
||||
|
||||
git ls-tree HEAD */*/* | php .github/recipes-checker-main/run generate:flex-index ${{ github.repository }} flex-main > flex-index.json
|
||||
git switch 'flex/main'
|
||||
mv flex-index.json index.json
|
||||
git add index.json
|
||||
git commit -m 'Update Flex index' || true
|
||||
git switch -
|
||||
|
||||
git branch --list 'flex-main/*' | xargs -r git push origin -f flex/main
|
||||
git branch -r --list 'origin/flex-main/*' \
|
||||
| sed 's/[^/]*\//:/' \
|
||||
| grep -Fxv "$(find -mindepth 2 -maxdepth 2 -not -wholename './.*' | sed 's/../:flex-main\//')" \
|
||||
| xargs -r git push origin || true
|
||||
@@ -0,0 +1,30 @@
|
||||
name: Closing PR
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [ closed ]
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
|
||||
cleanup:
|
||||
name: Cleanup
|
||||
runs-on: Ubuntu-20.04
|
||||
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
id: checkout
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
-
|
||||
name: Cleanup Flex testing endpoint
|
||||
run: |
|
||||
git branch -r --list 'origin/flex-pull-${{ github.event.number }}/*' \
|
||||
| sed 's/[^/]*\//:/' \
|
||||
| xargs -r git push origin :flex/pull-${{ github.event.number }} || true
|
||||
@@ -19,12 +19,16 @@ jobs:
|
||||
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 - https://github.com/splitsh/lite/releases/download/v1.0.1/lite_linux_amd64.tar.gz | tar -zxp
|
||||
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
|
||||
@@ -40,14 +44,37 @@ jobs:
|
||||
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 -n10 rm -rf
|
||||
.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 == 'master'"
|
||||
run: |
|
||||
find -mindepth 2 -maxdepth 2 -not -wholename './.*' | cut -c 3- | xargs -r -n1 -I{} .github/splitsh-lite --prefix={} --target=refs/heads/flex-pull-${{ github.event.number }}/{}
|
||||
|
||||
git ls-tree HEAD */*/* | php .github/recipes-checker-main/run generate:flex-index ${{ github.repository }} flex-pull-${{ github.event.number }} > index.json
|
||||
git stash
|
||||
git switch -c pr
|
||||
git switch --orphan 'flex/pull-${{ github.event.number }}'
|
||||
git reset --hard -q
|
||||
git add index.json
|
||||
git commit -m 'Create Flex index' || true
|
||||
git switch pr
|
||||
git stash pop -q
|
||||
|
||||
git branch --list 'flex-pull-${{ github.event.number }}/*' | xargs -r git push origin -f flex/pull-${{ github.event.number }}
|
||||
git branch -r --list 'origin/flex-pull-${{ github.event.number }}/*' \
|
||||
| sed 's/[^/]*\//:/' \
|
||||
| grep -Fxv "$(find -mindepth 2 -maxdepth 2 -not -wholename './.*' | sed 's/../:flex-pull-${{ github.event.number }}\//')" \
|
||||
| xargs -r git push origin || true
|
||||
|
||||
-
|
||||
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 \
|
||||
| .github/recipes-checker-main/run diff-recipe-versions https://github.com/${{ github.repository }}/raw/flex/pull-${{ github.event.number }}/index.json \
|
||||
> .github/diff-recipe-versions.md
|
||||
|
||||
-
|
||||
|
||||
Reference in New Issue
Block a user