Skip to content

Commit 214aab7

Browse files
authored
Merge pull request #276 from lcpp-org/byexample-CI
[WIP] Add byexample workflow for doctesting README.md This adds automatic tests of the code snippets in the readme. Currently this only covers the examples, and not the installation section - there are some difficulties with configuring byexample to handle the much more complicated output of those sections, and all of the content therein is already being run as part of the github workflows anyway. What this will do is prevent changes to the examples from making the README outdated.
2 parents 0cc5705 + aada8ef commit 214aab7

File tree

2 files changed

+330
-292
lines changed

2 files changed

+330
-292
lines changed

.github/workflows/readme_doctests.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: README doctests
2+
3+
on:
4+
push:
5+
branches: [ main, dev ]
6+
pull_request:
7+
branches: [ main, dev ]
8+
schedule:
9+
- cron: "0 0 * * *"
10+
11+
jobs:
12+
build:
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: udpate
19+
run: |
20+
sudo apt-get update
21+
- name: Install curl
22+
run: |
23+
sudo apt-get install curl
24+
- name: Install rust
25+
run: |
26+
curl --proto '=https' --tlsv1.2 -sSf -y https://sh.rustup.rs | sh
27+
sudo apt-get install rustc cargo
28+
- name: Install pip for Python-3
29+
run: |
30+
sudo apt-get install python3-pip python3-dev
31+
- name: Install Python libraries
32+
run: |
33+
python3 -m pip install numpy shapely scipy matplotlib toml byexample
34+
- name: install Python Bindings
35+
run: |
36+
python3 -m pip install setuptools_rust testresources setuptools wheel
37+
python3 -m pip install --upgrade pip setuptools wheel
38+
python3 -m pip install .
39+
- name: run byexample
40+
run: |
41+
byexample -l python3,shell README.md -vvv --timeout 300 --no-enhance-diff -o '+norm-ws +rm=~ +term=dumb'

0 commit comments

Comments
 (0)