Skip to content

Commit

Permalink
introduce CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Moxinilian committed Apr 16, 2024
1 parent a372a6c commit b76a819
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/ci-book.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow ensures the book can still be built.
# CI checking of Python code in the book happens in the regular CI pytest.

name: CI - Book building

on:
# Trigger the workflow on push or pull request,
# but only for the main branch, and if the book
# has been modified.
push:
branches:
- main
paths:
- docs/book/**
pull_request:
paths:
- docs/book/**

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup mdBook
uses: peaceiris/[email protected]
with:
mdbook-version: '0.4.37'

- run: mdbook build docs/book
6 changes: 6 additions & 0 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,9 @@ jobs:
export PYTHONPATH=$(pwd)
lit -v tests/filecheck/
lit -v docs/Toy/examples/
- name: Execute book tests
run: |
for f in docs/book/**/*.py; do
python "$f";
done
3 changes: 3 additions & 0 deletions docs/book/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ language = "en"
multilingual = false
src = "src"
title = "The xDSL Book"

[build]
create-missing = false
4 changes: 4 additions & 0 deletions docs/book/src/starting.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Starting an xDSL project

TODO: installation steps, environment setup

```py
{{#include starting.py:test_op}}
```
9 changes: 9 additions & 0 deletions docs/book/src/starting.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from xdsl.irdl import IRDLOperation, irdl_op_definition

# fmt: off

# ANCHOR: test_op
@irdl_op_definition
class SomeTestOp(IRDLOperation):
name = "some.test"
# ANCHOR_END: test_op

0 comments on commit b76a819

Please sign in to comment.