WIP: Add a workflow to check Chinese support on macOS and Windows #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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/[email protected] | |
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/[email protected] | |
# workaround from https://github.com/iterative/cml/issues/1377 | |
- name: Setup NodeJS | |
uses: actions/[email protected] | |
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 |