Read from stdin and write to stdout #32
Workflow file for this run
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
name: Test | |
on: [push, pull_request] | |
env: | |
PYTHONFAULTHANDLER: x | |
ALL_TESTS: 1 | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- python-version: '3.10' | |
toxenv: py310 | |
- python-version: '3.11' | |
toxenv: py311 | |
- python-version: '3.11' | |
toxenv: pillow8.x | |
- python-version: '3.11' | |
toxenv: pillow9.x | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
sudo apt-get install fonts-ipafont-gothic ghostscript libjpeg8-dev libfreetype6-dev | |
pip install -U docutils tox | |
- name: Run tox | |
env: | |
TOXENV: ${{ matrix.toxenv }} | |
run: tox -- -v | |
native: | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] | |
include: | |
- os: 'ubuntu-latest' | |
platform: 'linux-amd64' | |
- os: 'ARM64' # self-hosted | |
platform: 'linux-arm64' | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.11 | |
# actions/setup-python does not work on arm64/linux | |
# https://github.com/actions/setup-python/issues/678 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
# we can skip this step since Python3 is already installed on the self-hosted runner. | |
if: ${{ matrix.platform != 'linux-arm64' }} | |
- name: Install dependencies | |
run: | | |
sudo apt-get install fonts-ipafont-gothic ghostscript libjpeg8-dev libfreetype6-dev ccache patchelf | |
pip install -U docutils tox nuitka | |
pip install .[pdf] | |
pip install seqdiag nwdiag actdiag | |
- name: Build single binary image | |
run: | | |
python3 -m nuitka --nofollow-import-to=*.tests \ | |
--nofollow-import-to=reportlab.graphics.testshapes \ | |
--include-module=actdiag \ | |
--include-module=nwdiag \ | |
--include-module=seqdiag \ | |
--include-module=packetdiag \ | |
--include-module=rackdiag \ | |
--include-module=reportlab.pdfgen.canvas \ | |
--include-module=blockdiag.imagedraw \ | |
--include-module=blockdiag.plugins \ | |
--include-module=blockdiag.utils \ | |
--include-module=blockdiag.noderenderer \ | |
--onefile src/blockdiag \ | |
--output-filename=blockdiag-bundle-${PLATFORM}.bin | |
env: | |
PLATFORM: ${{ matrix.os }} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: native-image-${{ matrix.os }} | |
path: ./*.bin | |
- name: Smoke test | |
run: | | |
echo 'blockdiag { A -> B; }' | ./blockdiag-bundle.bin -Tsvg - | |
echo 'blockdiag { A -> B; }' | ./blockdiag-bundle.bin -Tpng - | |
echo 'blockdiag { A -> B; }' | ./blockdiag-bundle.bin -Tpdf - | |
echo 'seqdiag { A -> B [label = "call"]; A <- B [label = "return"]; }' | ./blockdiag-bundle.bin -Tsvg --module=seqdiag - | |
echo 'actdiag { write -> convert -> image; lane user { label = "User"; write [label = "Writing reST"]; image [label = "Get diagram IMAGE"]; }; lane actdiag { convert [label = "Convert reST to Image"]; } }' | ./blockdiag-bundle.bin -Tsvg --module=actdiag - | |
echo 'packetdiag { colwidth = 32; node_height = 72; 0-15: Source Port; 16-31: Destination Port; }' | ./blockdiag-bundle.bin -Tsvg --module=packetdiag - | |
echo 'nwdiag { network dmz { web01; web02; }; network internal { web01; web02; db01; } }' | ./blockdiag-bundle.bin -Tsvg --module=nwdiag - | |
echo 'rackdiag { 8U; 1: UPS [2U]; 3: DB Server; 4: Web Server; 8: L3 Switch }' | ./blockdiag-bundle.bin -Tsvg --module=rackdiag - |