Skip to content

Commit

Permalink
Test example code from readme in CI
Browse files Browse the repository at this point in the history
To make sure that our example code actually works, this patch adds a CI
job that extracts the code and tries to run it.
  • Loading branch information
robin-nitrokey committed Jul 30, 2024
1 parent daf92b9 commit 71b5e88
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,22 @@ jobs:
run: ./venv/bin/pip install .
- name: Run test suite
run: ./venv/bin/python -m unittest -v
test-readme:
name: Run example code from readme
runs-on: ubuntu-latest
container: python:3.9-slim
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install required packages
run: apt update && apt install -y ${REQUIRED_PACKAGES} cargo git
- name: Install tangler
run: cargo install tangler@0.3.0
- name: Install Poetry
run: pip install poetry
- name: Create virtual environment
run: make install
- name: Extract code from readme
run: .cargo/bin/tangler python < README.md > readme.py
- name: Run code from readme
run: poetry run python readme.py

0 comments on commit 71b5e88

Please sign in to comment.