Skip to content

Commit ebd061f

Browse files
committed
Update CI workflows to install gawk and modify check command for UTF-8 support
The `make check`used to suppose that every chinese character is composed by 3 bytes when it is utf8 encoding. However, 𰻝 has 4 bytes.
1 parent cd2c344 commit ebd061f

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/continuous-build-data.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
- uses: actions/setup-python@v6
1919
with:
2020
python-version: '3.12'
21+
- name: Install gawk
22+
run: brew install gawk
2123
- name: Test data files
2224
run: make check
2325
working-directory: Source/Data

.github/workflows/continuous-integration-workflow-xcode-latest.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ jobs:
8888
run: xcodebuild -scheme McBopomofo -configuration Release build
8989
- name: Build McBopomofoInstaller
9090
run: xcodebuild -scheme McBopomofoInstaller -configuration Release build
91+
- name: Install gawk
92+
run: brew install gawk
9193
- name: Test data files
9294
run: make check
9395
working-directory: Source/Data

Source/Data/Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,13 @@ sort:
6161
@mv tmp exclusion.txt
6262

6363
check: SHELL:=/bin/bash
64-
check: export LC_ALL=C
64+
check: export LC_ALL=UTF-8
6565
check:
66-
@awk 'length($$1)/3!=NF-1' BPMFMappings.txt
67-
@awk '{print $$2,$$3,$$4,$$5,$$6,$$7}' BPMFMappings.txt | awk '/一/'
68-
@diff -u <(awk '{print $$1}' BPMFMappings.txt|sort -u) \
69-
<(awk 'length($$1)>4{print $$1}' phrase.occ|sort -u)
66+
# @brew install gawk
67+
@gawk 'length($$1)!=NF-1' BPMFMappings.txt
68+
@gawk '{print $$2,$$3,$$4,$$5,$$6,$$7}' BPMFMappings.txt | gawk '/一/'
69+
@diff -u <(gawk 'length($$1)>1{print $$1}' BPMFMappings.txt|sort -u) \
70+
<(gawk 'length($$1)>1{print $$1}' phrase.occ|sort -u)
7071

7172
tidy:
7273
@sed -i '' -e 's/ //g' phrase.occ

0 commit comments

Comments
 (0)