@@ -79,65 +79,68 @@ jobs:
7979
8080 symfony-code-block-checker:
8181 name: Code Blocks
82+
8283 runs-on: ubuntu-latest
84+
8385 continue-on-error: true
86+
8487 steps:
85- - name: Checkout code
86- uses: actions/checkout@v3
87- with:
88- path: 'docs'
89-
90- - name: Set-up PHP
91- uses: shivammathur/setup-php@v2
92- with:
93- php-version: 8.1
94- coverage: none
95-
96- - name: Fetch branch from where the PR started
97- working-directory: docs
98- run: git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
99-
100- - name: Find modified files
101- id: find-files
102- working-directory: docs
103- run: echo "files=$(git diff --name-only origin/${{ github.base_ref }} HEAD | grep ".rst" | tr '\n' ' ')" >> $GITHUB_OUTPUT
104-
105- - name: Get composer cache directory
106- id: composercache
107- working-directory: docs/_build
108- run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
109-
110- - name: Cache dependencies
111- if: ${{ steps.find-files.outputs.files }}
112- uses: actions/cache@v3
113- with:
114- path: ${{ steps.composercache.outputs.dir }}
115- key: ${{ runner.os }}-composer-codeBlocks-${{ hashFiles('_checker/composer.lock', '_sf_app/composer.lock') }}
116- restore-keys: ${{ runner.os }}-composer-codeBlocks-
117-
118- - name: Install dependencies
119- if: ${{ steps.find-files.outputs.files }}
120- run: composer create-project symfony-tools/code-block-checker:@dev _checker
121-
122- - name: Install test application
123- if: ${{ steps.find-files.outputs.files }}
124- run: |
125- git clone -b ${{ github.base_ref }} --depth 5 --single-branch https://github.com/symfony-tools/symfony-application.git _sf_app
126- cd _sf_app
127- composer update
128-
129- - name: Generate baseline
130- if: ${{ steps.find-files.outputs.files }}
131- working-directory: docs
132- run: |
133- CURRENT=$(git rev-parse HEAD)
134- git checkout -m ${{ github.base_ref }}
135- ../_checker/code-block-checker.php verify:docs `pwd` ${{ steps.find-files.outputs.files }} --generate-baseline=baseline.json --symfony-application=`realpath ../_sf_app`
136- git checkout -m $CURRENT
137- cat baseline.json
138-
139- - name: Verify examples
140- if: ${{ steps.find-files.outputs.files }}
141- working-directory: docs
142- run: |
143- ../_checker/code-block-checker.php verify:docs `pwd` ${{ steps.find-files.outputs.files }} --baseline=baseline.json --output-format=github --symfony-application=`realpath ../_sf_app`
88+ - name: Checkout code
89+ uses: actions/checkout@v3
90+ with:
91+ path: 'docs'
92+
93+ - name: Set-up PHP
94+ uses: shivammathur/setup-php@v2
95+ with:
96+ php-version: 8.1
97+ coverage: none
98+
99+ - name: Fetch branch from where the PR started
100+ working-directory: docs
101+ run: git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
102+
103+ - name: Find modified files
104+ id: find-files
105+ working-directory: docs
106+ run: echo "files=$(git diff --name-only origin/${{ github.base_ref }} HEAD | grep ".rst" | tr '\n' ' ')" >> $GITHUB_OUTPUT
107+
108+ - name: Get composer cache directory
109+ id: composercache
110+ working-directory: docs/_build
111+ run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
112+
113+ - name: Cache dependencies
114+ if: ${{ steps.find-files.outputs.files }}
115+ uses: actions/cache@v3
116+ with:
117+ path: ${{ steps.composercache.outputs.dir }}
118+ key: ${{ runner.os }}-composer-codeBlocks-${{ hashFiles('_checker/composer.lock', '_sf_app/composer.lock') }}
119+ restore-keys: ${{ runner.os }}-composer-codeBlocks-
120+
121+ - name: Install dependencies
122+ if: ${{ steps.find-files.outputs.files }}
123+ run: composer create-project symfony-tools/code-block-checker:@dev _checker
124+
125+ - name: Install test application
126+ if: ${{ steps.find-files.outputs.files }}
127+ run: |
128+ git clone -b ${{ github.base_ref }} --depth 5 --single-branch https://github.com/symfony-tools/symfony-application.git _sf_app
129+ cd _sf_app
130+ composer update
131+
132+ - name: Generate baseline
133+ if: ${{ steps.find-files.outputs.files }}
134+ working-directory: docs
135+ run: |
136+ CURRENT=$(git rev-parse HEAD)
137+ git checkout -m ${{ github.base_ref }}
138+ ../_checker/code-block-checker.php verify:docs `pwd` ${{ steps.find-files.outputs.files }} --generate-baseline=baseline.json --symfony-application=`realpath ../_sf_app`
139+ git checkout -m $CURRENT
140+ cat baseline.json
141+
142+ - name: Verify examples
143+ if: ${{ steps.find-files.outputs.files }}
144+ working-directory: docs
145+ run: |
146+ ../_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