常见的抽样分布 #205
This file contains hidden or 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
on: | |
push: | |
branches: main | |
pull_request: | |
branches: main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
name: Book-MacOS | |
jobs: | |
build-deploy: | |
runs-on: macos-15 | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
PANDOC_VERSION: "3.6.3" | |
RETICULATE_PYTHON_ENV: /opt/.virtualenvs/r-tensorflow | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Quarto | |
uses: quarto-dev/quarto-actions/setup@v2 | |
with: | |
version: 1.7.32 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
r-version: '4.5.1' | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
- name: Install Pandoc | |
uses: r-lib/actions/setup-pandoc@v2 | |
with: | |
pandoc-version: ${{ env.PANDOC_VERSION }} | |
- name: Install TinyTeX | |
uses: r-lib/actions/setup-tinytex@v2 | |
env: | |
# install full prebuilt version | |
TINYTEX_INSTALLER: TinyTeX | |
- name: Install Fonts From System | |
run: | | |
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 | |
brew install optipng jags virtualenv | |
brew install --cask xquartz | |
brew install --cask font-noto-sans-cjk-sc font-noto-serif-cjk-sc | |
fc-list | sort | |
- name: Install LaTeX packages | |
run: | | |
if(!require('tinytex')) install.packages('tinytex') | |
tinytex::tlmgr_install(readLines("docker/texlive.txt")) | |
tinytex::tl_pkgs() | |
tikzDevice::tikzTest("m", engine = "xetex") | |
tikzDevice::tikzTest("$\\sin(x^2/2 - y^2/4 + 3) \\cos(2 x + 1 - \\exp(y))$") | |
shell: Rscript {0} | |
- name: Render Book | |
run: | | |
quarto check | |
quarto render | |
shell: bash | |
- name: Deploy book to bookdown.org | |
if: github.event_name == 'pull_request' | |
env: | |
CONNECT_API_KEY: ${{ secrets.RSC_BOOKDOWN_TOKEN }} | |
CONTENT_ID: ${{ secrets.RSC_BOOKDOWN_APP_ID }} | |
run: | | |
Rscript '_deploy.R' | |
shell: bash | |
- name: Upload book folder for debug | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Upload Book | |
path: _book |