@@ -111,6 +111,8 @@ jobs:
111
111
steps :
112
112
- name : Checkout code
113
113
uses : actions/checkout@v2
114
+ with :
115
+ path : ' docs'
114
116
115
117
- name : Set-up PHP
116
118
uses : shivammathur/setup-php@v2
@@ -119,35 +121,41 @@ jobs:
119
121
coverage : none
120
122
121
123
- name : Fetch branch from where the PR started
124
+ working-directory : docs
122
125
run : git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
123
126
124
127
- name : Find modified files
125
128
id : find-files
129
+ working-directory : docs
126
130
run : echo "::set-output name=files::$(git diff --name-only origin/${{ github.base_ref }} HEAD | grep ".rst" | tr '\n' ' ')"
127
131
128
132
- name : Get composer cache directory
129
133
id : composercache
130
- working-directory : _build
134
+ working-directory : docs/ _build
131
135
run : echo "::set-output name=dir::$(composer config cache-files-dir)"
132
136
133
137
- name : Cache dependencies
138
+ if : ${{ steps.find-files.outputs.files }}
134
139
uses : actions/cache@v2
135
140
with :
136
141
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-
139
144
140
145
- name : Install dependencies
141
- run : composer create-project symfony-tools/code-block-checker ../_checker
146
+ if : ${{ steps.find-files.outputs.files }}
147
+ run : composer create-project symfony-tools/code-block-checker _checker
142
148
143
149
- name : Install test application
150
+ if : ${{ steps.find-files.outputs.files }}
144
151
run : |
145
- git clone -b ${{ github.base_ref }} --depth 5 --single-branch https://github.com/symfony-tools/symfony-application.git ../ _sf_app
146
- 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
147
154
composer update
148
155
149
156
- name : Generate baseline
150
157
if : ${{ steps.find-files.outputs.files }}
158
+ working-directory : docs
151
159
run : |
152
160
CURRENT=$(git rev-parse HEAD)
153
161
git checkout -m ${{ github.base_ref }}
@@ -157,5 +165,6 @@ jobs:
157
165
158
166
- name : Verify examples
159
167
if : ${{ steps.find-files.outputs.files }}
168
+ working-directory : docs
160
169
run : |
161
170
../_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