Skip to content

Commit 7bff8b5

Browse files
alexislefebvrejaviereguiluz
authored andcommitted
Enable code blocks
1 parent 8f250a2 commit 7bff8b5

File tree

3 files changed

+68
-71
lines changed

3 files changed

+68
-71
lines changed

.github/workflows/ci.yaml

+64-69
Original file line numberDiff line numberDiff line change
@@ -74,72 +74,67 @@ jobs:
7474
with:
7575
args: --short --error-format=github --cache-file=/github/workspace/.cache/doctor-rst.cache
7676

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

_build/composer.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
"preferred-install": {
99
"*": "dist"
1010
},
11-
"sort-packages": true
11+
"sort-packages": true,
12+
"allow-plugins": {
13+
"symfony/flex": true
14+
}
1215
},
1316
"require": {
1417
"php": ">=7.4",

security.rst

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
Security
55
========
66

7-
87
Symfony provides many tools to secure your application. Some HTTP-related
98
security tools, like :doc:`secure session cookies </session>` and
109
:doc:`CSRF protection </security/csrf>` are provided by default. The

0 commit comments

Comments
 (0)