Skip to content

Commit

Permalink
Merge branch '5.4' into 6.4
Browse files Browse the repository at this point in the history
* 5.4:
  Fix indentation
  • Loading branch information
OskarStark committed Apr 29, 2024
2 parents 9aba5ef + f541adb commit 6baba49
Showing 1 changed file with 62 additions and 59 deletions.
121 changes: 62 additions & 59 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,65 +79,68 @@ jobs:

symfony-code-block-checker:
name: Code Blocks

runs-on: ubuntu-latest

continue-on-error: true

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
path: 'docs'

- name: Set-up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
coverage: none

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

- name: Find modified files
id: find-files
working-directory: docs
run: echo "files=$(git diff --name-only origin/${{ github.base_ref }} HEAD | grep ".rst" | tr '\n' ' ')" >> $GITHUB_OUTPUT

- name: Get composer cache directory
id: composercache
working-directory: docs/_build
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
if: ${{ steps.find-files.outputs.files }}
uses: actions/cache@v3
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-codeBlocks-${{ hashFiles('_checker/composer.lock', '_sf_app/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-codeBlocks-

- name: Install dependencies
if: ${{ steps.find-files.outputs.files }}
run: composer create-project symfony-tools/code-block-checker:@dev _checker

- name: Install test application
if: ${{ steps.find-files.outputs.files }}
run: |
git clone -b ${{ github.base_ref }} --depth 5 --single-branch https://github.com/symfony-tools/symfony-application.git _sf_app
cd _sf_app
composer update
- name: Generate baseline
if: ${{ steps.find-files.outputs.files }}
working-directory: docs
run: |
CURRENT=$(git rev-parse HEAD)
git checkout -m ${{ github.base_ref }}
../_checker/code-block-checker.php verify:docs `pwd` ${{ steps.find-files.outputs.files }} --generate-baseline=baseline.json --symfony-application=`realpath ../_sf_app`
git checkout -m $CURRENT
cat baseline.json
- name: Verify examples
if: ${{ steps.find-files.outputs.files }}
working-directory: docs
run: |
../_checker/code-block-checker.php verify:docs `pwd` ${{ steps.find-files.outputs.files }} --baseline=baseline.json --output-format=github --symfony-application=`realpath ../_sf_app`
- name: Checkout code
uses: actions/checkout@v3
with:
path: 'docs'

- name: Set-up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
coverage: none

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

- name: Find modified files
id: find-files
working-directory: docs
run: echo "files=$(git diff --name-only origin/${{ github.base_ref }} HEAD | grep ".rst" | tr '\n' ' ')" >> $GITHUB_OUTPUT

- name: Get composer cache directory
id: composercache
working-directory: docs/_build
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
if: ${{ steps.find-files.outputs.files }}
uses: actions/cache@v3
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-codeBlocks-${{ hashFiles('_checker/composer.lock', '_sf_app/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-codeBlocks-

- name: Install dependencies
if: ${{ steps.find-files.outputs.files }}
run: composer create-project symfony-tools/code-block-checker:@dev _checker

- name: Install test application
if: ${{ steps.find-files.outputs.files }}
run: |
git clone -b ${{ github.base_ref }} --depth 5 --single-branch https://github.com/symfony-tools/symfony-application.git _sf_app
cd _sf_app
composer update
- name: Generate baseline
if: ${{ steps.find-files.outputs.files }}
working-directory: docs
run: |
CURRENT=$(git rev-parse HEAD)
git checkout -m ${{ github.base_ref }}
../_checker/code-block-checker.php verify:docs `pwd` ${{ steps.find-files.outputs.files }} --generate-baseline=baseline.json --symfony-application=`realpath ../_sf_app`
git checkout -m $CURRENT
cat baseline.json
- name: Verify examples
if: ${{ steps.find-files.outputs.files }}
working-directory: docs
run: |
../_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 comments on commit 6baba49

Please sign in to comment.