This repository was archived by the owner on Mar 23, 2025. It is now read-only.
chore(deps): update ruff requirement from <0.8.2 to <0.8.5 #69
Workflow file for this run
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
--- | |
name: CI | |
"on": | |
push: | |
branches: | |
- master | |
paths: | |
- 'pandoc_imagine.py' | |
- '_readme.md' | |
- 'pyproject.toml' | |
- 'tests/*' | |
pull_request: | |
branches: | |
- master | |
paths: | |
- 'pandoc_imagine.py' | |
- '_readme.md' | |
- 'pyproject.toml' | |
- 'tests/*' | |
jobs: | |
test: | |
name: test python | |
permissions: | |
contents: read | |
strategy: | |
fail-fast: true | |
matrix: | |
version: | |
- "3.10" | |
- "3.11" | |
- "3.12" | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout project | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
- name: setup python | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b | |
with: | |
python-version: '${{ matrix.version }}' | |
- name: install python deps | |
run: | | |
set -x | |
python3 -m venv .venv | |
.venv/bin/pip install -e .[dev] | |
- name: install opa | |
uses: open-policy-agent/setup-opa@34a30e8a924d1b03ce2cf7abe97250bbb1f332b5 | |
- name: install just | |
uses: taiki-e/install-action@acd25891978b4cdaebd139d3efef606d26513b14 | |
with: | |
tool: just | |
checksum: true | |
- name: install pandoc | |
run: | | |
set -x | |
latest_uri="$(curl -sL https://api.github.com/repos/jgm/pandoc/releases/latest | jq -r ".assets[] | select(.name | test(\"amd64.tar.gz\$\")) | .browser_download_url")" | |
curl -JSOL "$latest_uri" | |
mkdir -p pandoc | |
tar xvzf "$(basename "$latest_u 4595 ri")" --strip-components 1 -C pandoc | |
sudo install pandoc/bin/pandoc /usr/local/bin | |
- name: ruff check pandoc_imagine | |
run: | | |
set -x | |
src="./pandoc_imagine.py" | |
.venv/bin/ruff check -v "$src" | |
.venv/bin/ruff format --check -v "$src" | |
- name: test pandoc_imagine | |
run: | | |
just -d tests/ -f tests/justfile data | |
just -d tests/ -f tests/justfile input | |
just -d tests/ -f tests/justfile test | |
env: | |
PANDOC: /usr/local/bin/pandoc | |
readme: | |
name: generate readme | |
needs: test | |
permissions: | |
contents: write | |
if: github.event_name == 'push' | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout project | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
- name: setup pandoc | |
run: | | |
set -x | |
echo "GITHUB_SHA_SHORT=$(echo "$GITHUB_SHA" | cut -c 1-7)" >> "$GITHUB_ENV" | |
docker run --rm --detach --interactive --name pandoc --user "$(id -u)":"$(id -g)" -v "$PWD":/pandoc_slides ghcr.io/andros21/pandoc-slides:latest | |
docker exec -u 0 -w /tmp pandoc sh -c 'curl -sSf $JAVA_TRIGGER_URL | sh' | |
docker exec -u 0 -w /tmp pandoc dot -c | |
docker exec -u 0 -w /tmp pandoc python3 -m venv --system-site-packages /opt/imagine | |
docker exec -u 0 -w /tmp --env "GITHUB_SHA=$GITHUB_SHA" pandoc \ | |
sh -c '/opt/imagine/bin/pip install --no-cache-dir --disable-pip-version-check git+https://github.com/andros21/imagine.git@$GITHUB_SHA' | |
- name: generate readme | |
run: | | |
set -x | |
docker exec pandoc sh -c 'pandoc --filter pandoc-imagine _readme.md -t gfm -o README.md' | |
# patch block quotes | |
sed -i 's/\\\[!/[!/;s/\\\]/]\n>/g' README.md | |
- name: commit readme | |
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 | |
with: | |
message: 'build(${{ env.GITHUB_SHA_SHORT }}): render from template using imagine' | |
add: "['README.md', 'pd-images/']" |