Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/chinese.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#
# 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 "macOS" > report.md
echo '![](source/chinese/GMT_Chinese.png)' >> report.md
cml comment update report.md
Loading