From 554c905140182cc7aeb651570d5be7ec2f190842 Mon Sep 17 00:00:00 2001 From: Alex Li Date: Fri, 22 Sep 2023 11:36:11 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=91=B7=20Add=20file=20size=20checks?= =?UTF-8?q?=20for=20publishable=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/publishable.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/publishable.yml b/.github/workflows/publishable.yml index 95ed42c52..780c8d92a 100644 --- a/.github/workflows/publishable.yml +++ b/.github/workflows/publishable.yml @@ -27,6 +27,20 @@ jobs: directory: ["dio", "plugins/cookie_manager", "plugins/http2_adapter", "plugins/native_dio_adapter"] steps: - uses: actions/checkout@v3 + - name: "Check documents file size < 128kb" + working-directory: ${{ matrix.directory }} + run: | + limit_size=$(expr 128 \* 1024) # Maximum 128kb. + readme_size=$(stat -c%s README.md) + changelog_size=$(stat -c%s CHANGELOG.md) + if [ $readme_size -gt $limit_size ]; then + echo "README.md exceeded the maximum size: $readme_size > $limit_size." + exit 1 + fi + if [ $changelog_size -gt $limit_size ]; then + echo "CHANGELOG.md exceeded the maximum size: $changelog_size > $limit_size." + exit 1 + fi - uses: subosito/flutter-action@v2 - run: | if grep -q "flutter:" "${{ matrix.directory }}/pubspec.yaml"; then From cc5d4ed6061e44274f236552c47a5b304c96aff3 Mon Sep 17 00:00:00 2001 From: Alex Li Date: Fri, 22 Sep 2023 11:39:32 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=93=9D=20Fix=20reference=20in=20doc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dio/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dio/CHANGELOG.md b/dio/CHANGELOG.md index f3df5e24e..ce0fc597e 100644 --- a/dio/CHANGELOG.md +++ b/dio/CHANGELOG.md @@ -372,4 +372,4 @@ First Stable version for 2.x - Initial version, created by Stagehand -[Migration Guide]: ./migration_guide.md +[Migration Guide]: doc/migration_guide.md From f62ae2efe85ceb394182a086bc2b6a0f5fc94d0d Mon Sep 17 00:00:00 2001 From: Alex Li Date: Fri, 22 Sep 2023 13:44:42 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=9A=80=20Add=20README=5FZH.md=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/publishable.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publishable.yml b/.github/workflows/publishable.yml index 780c8d92a..2a78109b4 100644 --- a/.github/workflows/publishable.yml +++ b/.github/workflows/publishable.yml @@ -31,15 +31,22 @@ jobs: working-directory: ${{ matrix.directory }} run: | limit_size=$(expr 128 \* 1024) # Maximum 128kb. - readme_size=$(stat -c%s README.md) changelog_size=$(stat -c%s CHANGELOG.md) + if [ $changelog_size -gt $limit_size ]; then + echo "CHANGELOG.md exceeded the maximum size: $changelog_size > $limit_size." + exit 1 + fi + readme_size=$(stat -c%s README.md) if [ $readme_size -gt $limit_size ]; then echo "README.md exceeded the maximum size: $readme_size > $limit_size." exit 1 fi - if [ $changelog_size -gt $limit_size ]; then - echo "CHANGELOG.md exceeded the maximum size: $changelog_size > $limit_size." - exit 1 + if [ -f README_ZH.md ]; then + readme_zh_size=$(stat -c%s README_ZH.md) + if [ readme_zh_size -gt $limit_size ]; then + echo "README_ZH.md exceeded the maximum size: $readme_zh_size > $limit_size." + exit 1 + fi fi - uses: subosito/flutter-action@v2 - run: | From 72eb7915d2c30ea2a5269b6079b9f43deb15a194 Mon Sep 17 00:00:00 2001 From: Alex Li Date: Fri, 22 Sep 2023 13:48:34 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=94=8A=20Log=20file=20sizes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/publishable.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/publishable.yml b/.github/workflows/publishable.yml index 2a78109b4..1de8313a8 100644 --- a/.github/workflows/publishable.yml +++ b/.github/workflows/publishable.yml @@ -32,17 +32,20 @@ jobs: run: | limit_size=$(expr 128 \* 1024) # Maximum 128kb. changelog_size=$(stat -c%s CHANGELOG.md) + echo "CHANGELOG.md file size: $changelog_size." if [ $changelog_size -gt $limit_size ]; then echo "CHANGELOG.md exceeded the maximum size: $changelog_size > $limit_size." exit 1 fi readme_size=$(stat -c%s README.md) + echo "README.md file size: $readme_size." if [ $readme_size -gt $limit_size ]; then echo "README.md exceeded the maximum size: $readme_size > $limit_size." exit 1 fi if [ -f README_ZH.md ]; then readme_zh_size=$(stat -c%s README_ZH.md) + echo "README_ZH.md file size: $readme_zh_size." if [ readme_zh_size -gt $limit_size ]; then echo "README_ZH.md exceeded the maximum size: $readme_zh_size > $limit_size." exit 1