Skip to content

Commit c747cb8

Browse files
committed
Merge branch '4.4' into 5.2
* 4.4: [CI] Make sure composer cache is properly used
2 parents 9c539ec + 06e3809 commit c747cb8

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

.github/workflows/ci.yaml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ jobs:
111111
steps:
112112
- name: Checkout code
113113
uses: actions/checkout@v2
114+
with:
115+
path: 'docs'
114116

115117
- name: Set-up PHP
116118
uses: shivammathur/setup-php@v2
@@ -119,37 +121,41 @@ jobs:
119121
coverage: none
120122

121123
- name: Fetch branch from where the PR started
124+
working-directory: docs
122125
run: git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
123126

124127
- name: Find modified files
125128
id: find-files
129+
working-directory: docs
126130
run: echo "::set-output name=files::$(git diff --name-only origin/${{ github.base_ref }} HEAD | grep ".rst" | tr '\n' ' ')"
127131

128132
- name: Get composer cache directory
129133
id: composercache
130-
working-directory: _build
134+
working-directory: docs/_build
131135
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
132136

133137
- name: Cache dependencies
138+
if: ${{ steps.find-files.outputs.files }}
134139
uses: actions/cache@v2
135140
with:
136141
path: ${{ steps.composercache.outputs.dir }}
137-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
138-
restore-keys: ${{ runner.os }}-composer-
142+
key: ${{ runner.os }}-composer-codeBlocks-${{ hashFiles('_checker/composer.lock', '_sf_app/composer.lock') }}
143+
restore-keys: ${{ runner.os }}-composer-codeBlocks-
139144

140145
- name: Install dependencies
141146
if: ${{ steps.find-files.outputs.files }}
142-
run: composer create-project symfony-tools/code-block-checker ../_checker
147+
run: composer create-project symfony-tools/code-block-checker _checker
143148

144149
- name: Install test application
145150
if: ${{ steps.find-files.outputs.files }}
146151
run: |
147-
git clone -b ${{ github.base_ref }} --depth 5 --single-branch https://github.com/symfony-tools/symfony-application.git ../_sf_app
148-
cd ../_sf_app
152+
git clone -b ${{ github.base_ref }} --depth 5 --single-branch https://github.com/symfony-tools/symfony-application.git _sf_app
153+
cd _sf_app
149154
composer update
150155
151156
- name: Generate baseline
152157
if: ${{ steps.find-files.outputs.files }}
158+
working-directory: docs
153159
run: |
154160
CURRENT=$(git rev-parse HEAD)
155161
git checkout -m ${{ github.base_ref }}
@@ -159,5 +165,6 @@ jobs:
159165
160166
- name: Verify examples
161167
if: ${{ steps.find-files.outputs.files }}
168+
working-directory: docs
162169
run: |
163170
../_checker/code-block-checker.php verify:docs `pwd` ${{ steps.find-files.outputs.files }} --baseline=baseline.json --output-format=github --symfony-application=`realpath ../_sf_app`

0 commit comments

Comments
 (0)