Skip to content

Commit e043a09

Browse files
Improve layout of Flex endpoint
1 parent 4b3c1ef commit e043a09

File tree

4 files changed

+24
-52
lines changed

4 files changed

+24
-52
lines changed

.github/workflows/create-project.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Q&A
1+
name: Run updated recipes
22

33
on:
44
pull_request:
@@ -10,7 +10,7 @@ defaults:
1010
jobs:
1111

1212
create-project:
13-
name: Create-project
13+
name: Run updated recipes
1414
runs-on: Ubuntu-20.04
1515

1616
steps:

.github/workflows/flex-endpoint.yml

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Flex
1+
name: Update Flex endpoint
22

33
on:
44
push:
@@ -12,7 +12,7 @@ defaults:
1212
jobs:
1313

1414
update:
15-
name: Update endpoint
15+
name: Update Flex endpoint
1616
runs-on: Ubuntu-20.04
1717

1818
steps:
@@ -29,35 +29,19 @@ jobs:
2929
git config --global user.email ""
3030
git config --global user.name "github-action bot"
3131
cd .github
32-
wget -q -O - https://github.com/splitsh/lite/releases/download/v1.0.1/lite_linux_amd64.tar.gz | tar -zxp
3332
wget -q -O recipes-checker.zip https://codeload.github.com/symfony-tools/recipes-checker/zip/refs/heads/main
3433
unzip recipes-checker.zip
3534
cd recipes-checker-main
3635
composer install --ansi --no-dev
3736
38-
-
39-
name: Cache Splitsh-lite
40-
uses: actions/cache@v2
41-
with:
42-
path: .git/splitsh.db
43-
key: ${{ runner.os }}-main-${{ github.sha }}
44-
restore-keys: ${{ runner.os }}-main-
45-
4637
-
4738
name: Update Flex endpoint
4839
run: |
49-
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
50-
[ -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/{}
51-
52-
git ls-tree HEAD */*/* | php .github/recipes-checker-main/run generate:flex-index ${{ github.repository }} flex-main > flex-index.json
53-
git switch 'flex/main'
54-
mv flex-index.json index.json
55-
git add index.json
56-
git commit -m 'Update Flex index' || true
57-
git switch -
58-
59-
git branch --list 'flex-main/*' | xargs -r git push origin -f flex/main
60-
git branch -r --list 'origin/flex-main/*' \
61-
| sed 's/[^/]*\//:/' \
62-
| grep -Fxv "$(find -mindepth 2 -maxdepth 2 -not -wholename './.*' | sed 's/../:flex-main\//')" \
63-
| xargs -r git push origin || true
40+
mkdir .github/flex-endpoint
41+
git ls-tree HEAD */*/* | php .github/recipes-checker-main/run generate:flex-endpoint ${{ github.repository }} master flex/main .github/flex-endpoint
42+
git switch flex/main
43+
git rm -q *.json
44+
mv .github/flex-endpoint/*.json .
45+
git add *.json
46+
git commit -m 'Update Flex endpoint' || true
47+
git push origin -f flex/main

.github/workflows/pr-cleanup.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Closing PR
1+
name: Cleanup Flex testing endpoint
22

33
on:
44
pull_request_target:
@@ -11,20 +11,15 @@ defaults:
1111
jobs:
1212

1313
cleanup:
14-
name: Cleanup
14+
name: Cleanup Flex testing endpoint
1515
runs-on: Ubuntu-20.04
1616

1717
steps:
1818
-
1919
name: Checkout
2020
uses: actions/checkout@v2
21-
id: checkout
22-
with:
23-
fetch-depth: 0
2421

2522
-
2623
name: Cleanup Flex testing endpoint
2724
run: |
28-
git branch -r --list 'origin/flex-pull-${{ github.event.number }}/*' \
29-
| sed 's/[^/]*\//:/' \
30-
| xargs -r git push origin :flex/pull-${{ github.event.number }} || true
25+
git push origin :flex/pull-${{ github.event.number }} || true

.github/workflows/qa.yml

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Q&A
1+
name: Run checks
22

33
on:
44
pull_request_target:
@@ -10,7 +10,7 @@ defaults:
1010
jobs:
1111

1212
tests:
13-
name: Checks
13+
name: Run checks
1414
runs-on: Ubuntu-20.04
1515

1616
steps:
@@ -28,7 +28,6 @@ jobs:
2828
git config --global user.email ""
2929
git config --global user.name "github-action bot"
3030
cd .github
31-
wget -q -O - https://github.com/splitsh/lite/releases/download/v1.0.1/lite_linux_amd64.tar.gz | tar -zxp
3231
wget -q -O recipes-checker.zip https://codeload.github.com/symfony-tools/recipes-checker/zip/refs/heads/main
3332
unzip recipes-checker.zip
3433
cd recipes-checker-main
@@ -46,29 +45,23 @@ jobs:
4645
run: |
4746
.github/recipes-checker-main/run list-unpatched-packages $GITHUB_EVENT_PATH ${{ secrets.GITHUB_TOKEN }} | xargs -r -n10 rm -rf
4847
49-
5048
-
5149
name: Generate Flex testing endpoint
5250
if: "always() && steps.checkout.outcome == 'success' && github.base_ref == 'master'"
5351
run: |
54-
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 }}/{}
55-
56-
git ls-tree HEAD */*/* | php .github/recipes-checker-main/run generate:flex-index ${{ github.repository }} flex-pull-${{ github.event.number }} > index.json
52+
mkdir .github/flex-endpoint
53+
git ls-tree HEAD */*/* | php .github/recipes-checker-main/run generate:flex-endpoint ${{ github.repository }} master flex/pull-${{ github.event.number }} .github/flex-endpoint
5754
git stash
5855
git switch -c pr
59-
git switch --orphan 'flex/pull-${{ github.event.number }}'
56+
git switch --orphan flex/pull-${{ github.event.number }}
6057
git reset --hard -q
61-
git add index.json
62-
git commit -m 'Create Flex index' || true
58+
mv .github/flex-endpoint/*.json .
59+
git add *.json
60+
git commit -m 'Create Flex endpoint' || true
61+
git push origin -f flex/pull-${{ github.event.number }}
6362
git switch pr
6463
git stash pop -q
6564
66-
git branch --list 'flex-pull-${{ github.event.number }}/*' | xargs -r git push origin -f flex/pull-${{ github.event.number }}
67-
git branch -r --list 'origin/flex-pull-${{ github.event.number }}/*' \
68-
| sed 's/[^/]*\//:/' \
69-
| grep -Fxv "$(find -mindepth 2 -maxdepth 2 -not -wholename './.*' | sed 's/../:flex-pull-${{ github.event.number }}\//')" \
70-
| xargs -r git push origin || true
71-
7265
-
7366
name: Compute diff between recipe versions
7467
if: "always() && steps.checkout.outcome == 'success'"

0 commit comments

Comments
 (0)