From 520c97a41362b4ef54d2a214ef82e278067b6ace Mon Sep 17 00:00:00 2001 From: Daniel Bershatsky Date: Mon, 2 Sep 2024 15:03:08 +0300 Subject: [PATCH] Install `typst` binary in CI workflow (#8) --- .github/workflows/on-push.yml | 21 +++++++++++---------- .github/workflows/on-schedule.yml | 12 +++++++++++- README.md | 4 ++-- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/.github/workflows/on-push.yml b/.github/workflows/on-push.yml index c890639..abdd804 100644 --- a/.github/workflows/on-push.yml +++ b/.github/workflows/on-push.yml @@ -66,7 +66,17 @@ jobs: run: | rm -rfv /etc/apt/apt.conf.d/docker* apt update - apt install -y --no-install-recommends ca-certificates git sqlite3 + apt install -y --no-install-recommends \ + ca-certificates git sqlite3 wget xz-utils + - name: Install Typst binary + env: + TYPST_RELEASE: https://github.com/typst/typst/releases/download + run: | + mkdir -p /usr/src/typst + cd /usr/src/typst + wget "$TYPST_RELEASE/v0.11.1/typst-x86_64-unknown-linux-musl.tar.xz" + tar xf typst-x86_64-unknown-linux-musl.tar.xz + install -Dm 755 -t /usr/local/bin typst-x86_64-unknown-linux-musl/typst # NOTE Step order is important for checkout in container: git # installation in container precedes repo checkout. # NOTE Values of ${GITHUB_WORKSPACE} and ${{ github.workspace }} differ @@ -99,16 +109,7 @@ jobs: python -m pip install matplotlib 'numpy>=2' # Testing dependencies. python -m pip install mypy 'pytest>=8.2' pytest-cov pytest-dirty - - name: Run dirty tests with PyTest - if: 'github.event.pull_request' - run: | - export PYTHON_TAG=$( - python -c 'import sys; print(sys.implementation.cache_tag)') - export PYTHONPATH=$PWD:$PYTHONPATH - .github/scripts/run-dirty-tests.sh \ - ${{ github.event.pull_request.head.ref }} - name: Run all tests with PyTest - if: '!github.event.pull_request' run: | export PYTHON_TAG=$( python -c 'import sys; print(sys.implementation.cache_tag)') diff --git a/.github/workflows/on-schedule.yml b/.github/workflows/on-schedule.yml index cbc8657..420137c 100644 --- a/.github/workflows/on-schedule.yml +++ b/.github/workflows/on-schedule.yml @@ -45,7 +45,17 @@ jobs: run: | rm -rfv /etc/apt/apt.conf.d/docker* apt update - apt install -y --no-install-recommends ca-certificates git sqlite3 + apt install -y --no-install-recommends \ + ca-certificates git sqlite3 wget xz-utils + - name: Install Typst binary + env: + TYPST_RELEASE: https://github.com/typst/typst/releases/download + run: | + mkdir -p /usr/src/typst + cd /usr/src/typst + wget $TYPST_RELEASE/v0.11.1/typst-x86_64-unknown-linux-musl.tar.xz + tar xf typst-x86_64-unknown-linux-musl.tar.xz + install -Dm 755 -t /usr/local/bin typst-x86_64-unknown-linux-musl/typst - name: Set up Python 3.12 uses: actions/setup-python@v4 with: diff --git a/README.md b/README.md index 207c1b8..666f83f 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ ![Linting and testing][1] ![Nightly][2] -[1]: https://github.com/daskol/typst-mpl-backend/actions/workflows/on-schedule.yml/badge.svg -[2]: https://github.com/daskol/typst-mpl-backend/actions/workflows/on-push.yml/badge.svg +[1]: https://github.com/daskol/typst-mpl-backend/actions/workflows/on-push.yml/badge.svg +[2]: https://github.com/daskol/typst-mpl-backend/actions/workflows/on-schedule.yml/badge.svg # Typst Matplotlib Backend