Skip to content

WIP: Add a workflow to check Chinese support on macOS and Windows #5

WIP: Add a workflow to check Chinese support on macOS and Windows

WIP: Add a workflow to check Chinese support on macOS and Windows #5

Workflow file for this run

#
# Check the GMT Chinese
#
name: Chinese support
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
macos:
runs-on: macos-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v1.4.4
with:
environment-name: gmt
condarc: |
channels:
- conda-forge
- nodefaults
create-args: >-
gmt=6.4.0
- name: Setup Chinese
run: |
mkdir -p ~/.gmt/winfonts/
git clone --depth 1 https://github.com/ZMAlt/winfonts
mv winfonts/*.ttf winfonts/*.ttc ~/.gmt/winfonts
rm -rf winfonts
cat > ~/.gmt/cidfmap << EOF
/STSong-Light <</FileType /TrueType /Path (${HOME}/.gmt/winfonts/simsun.ttc) /SubfontId 0 /CSI [(GB1) 4] >> ;
/STFangsong-Light <</FileType /TrueType /Path (${HOME}/.gmt/winfonts/simfang.ttf) /SubfontId 0 /CSI [(GB1) 4] >> ;
/STHeiti-Regular <</FileType /TrueType /Path (${HOME}/.gmt/winfonts/simhei.ttf) /SubfontId 0 /CSI [(GB1) 4] >> ;
/STKaiti-Regular <</FileType /TrueType /Path (${HOME}/.gmt/winfonts/simkai.ttf) /SubfontId 0 /CSI [(GB1) 4] >> ;
EOF
cat > ~/.gmt/PSL_custom_fonts.txt << EOF
STSong-Light--UniGB-UTF8-H 0.700 1
STFangsong-Light--UniGB-UTF8-H 0.700 1
STHeiti-Regular--UniGB-UTF8-H 0.700 1
STKaiti-Regular--UniGB-UTF8-H 0.700 1
STSong-Light--UniGB-UTF8-V 0.700 1
STFangsong-Light--UniGB-UTF8-V 0.700 1
STHeiti-Regular--UniGB-UTF8-V 0.700 1
STKaiti-Regular--UniGB-UTF8-V 0.700 1
EOF
- name: Run the Chinese script
run: bash source/chinese/GMT_Chinese.sh
- name: Setup continuous machine learning (CML)
uses: iterative/setup-cml@v1.2.3
# workaround from https://github.com/iterative/cml/issues/1377
- name: Setup NodeJS
uses: actions/setup-node@v3.8.1
with:
node-version: '16'
- name: Comment
env:
repo_token: ${{ secrets.GITHUB_TOKEN }}
run: |
#echo '![](source/chinese/GMT_Chinese.png)' > report.md
echo "macOS" > report.md
cml comment update report.md