Skip to content

Commit

Permalink
Adapt to dylan-tool (#29)
Browse files Browse the repository at this point in the history
- Add .gitignore

- Add package description

- Remove registry directory
  Will be created by dylan-tool

- Adapt documentation to 'dylan-tool':

  - Fix broken link to papers in documentation
  - Update obsolete link with Web archive reference
  - Fix broken links to 'drm' ($unsupplied and `<byte>)
  - Move papers in PDF format to sub-directory 'papers'
  - Adapt sphinx-extensions path to 'dylan-tool'
  - Set 'furo' theme as default
  - Remove table of contents from documentation for compatibility with
    'furo' theme.
  - Ignore certificate verification in documentation 'linkcheck'

- Update CI actions

  - Ignore documentation paths on building and testing
  - Update checkout and install-opendylan actions
  - Use dylan-tool to update package and build tests
  - Report tests in Xml format to publish
  - Add build documentation action
  - Add dependabot
  • Loading branch information
fraya authored Apr 3, 2024
1 parent f6f558d commit cfbff10
Show file tree
Hide file tree
Showing 14 changed files with 128 additions and 20 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
21 changes: 17 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ name: build-and-test
on:
push:
# all branches
paths-ignore:
- 'documentation/**'
pull_request:
branches:
- main
- master
paths-ignore:
- 'documentation/**'

# This enables the Run Workflow button on the Actions tab.
workflow_dispatch:
Expand All @@ -16,12 +20,21 @@ jobs:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: dylan-lang/install-opendylan@v2
- uses: dylan-lang/install-opendylan@v3

- name: Update packages
run: dylan update

- name: Build binary-data-test
run: ./dylan-compiler -build binary-data-test
run: dylan build binary-data-test

- name: Run binary-data-tests-test
run: _build/bin/binary-data-test
run: _build/bin/binary-data-test --progress none --report surefire > _build/TEST-binary-data.xml

- name: Publish Test Report
if: success() || failure()
uses: mikepenz/action-junit-report@v4
with:
report_paths: '**/_build/TEST-*.xml
60 changes: 60 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build documentation

on:
push:
# all branches
paths:
- 'documentation/**'
pull_request:
# all branches
paths:
- 'documentation/**'

# This enables the Run Workflow button on the Actions tab.
workflow_dispatch:

# https://github.com/JamesIves/github-pages-deploy-action#readme
permissions:
contents: write

# Set DYLAN environment variable to GITHUB_WORKSPACE so packages are
# installed in ../../_packages relative to documentation's Makefile
env:
DYLAN: ${{ github.workspace }}

jobs:

build-and-deploy:
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v4

- name: Check links
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/fraya/dylan-docs
options: -v ${{ github.workspace }}/documentation:/docs
run: make linkcheck

- name: Build docs with Furo theme
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/fraya/dylan-docs
options: -v ${{ github.workspace }}/documentation:/docs
run: make html

- name: Upload html artifact
uses: actions/upload-artifact@v4
with:
name: binary-data-doc-html
path: documentation/build/html/

- name: Bypassing Jekyll on GH Pages
run: sudo touch documentation/build/html/.nojekyll

- name: Deploy documents to GH pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: documentation/build/html
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
*~
*.hdp
*.iml
_build
.idea
documentation/build
registry/
_packages/
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ http://opendylan.org/documentation/binary-data/.

There are two papers about this project:

* `Secure networking <documentation/secure-networking.pdf>`_ [2006]
* `A domain-specific language for manipulation of binary data in Dylan <documentation/a-DSL-for-manipulation-of-binary-data.pdf>`_ [2007]
* `Secure networking <documentation/papers/secure-networking.pdf>`_ [2006]
* `A domain-specific language for manipulation of binary data in Dylan <documentation/papers/a-DSL-for-manipulation-of-binary-data.pdf>`_ [2007]

.. _Genera Common Lisp operating system: http://en.wikipedia.org/wiki/Genera_%28operating_system%29
File renamed without changes.
14 changes: 11 additions & 3 deletions documentation/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
# serve to show the default.

import sys, os
import sphinxcontrib.dylan.themes as dylan_themes

sys.path.insert(0, os.path.abspath('../../_packages/sphinx-extensions/current/src/sphinxcontrib'))

import dylan.themes as dylan_themes

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand All @@ -26,7 +29,9 @@

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinxcontrib.dylan.domain']
extensions = [
'dylan.domain'
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down Expand Up @@ -98,7 +103,7 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = dylan_themes.get_html_theme_default()
html_theme = 'furo'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down Expand Up @@ -271,3 +276,6 @@

# If false, no index is generated.
#epub_use_index = True

# Ignore certification verification
tls_verify = False
8 changes: 4 additions & 4 deletions documentation/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ at `GitHub
Inspiration for this library is taken among others from the defstorage
system available as part of the `Genera Common Lisp operating system
<http://en.wikipedia.org/wiki/Genera_%28operating_system%29>`_ and the
swiss-army knife for interactive packet manipulation `scapy
<http://bb.secdev.org/scapy/wiki/Home>`__.
swiss-army knife for interactive packet manipulation `scapy (Web archive)
<http://web.archive.org/web/20131217022133/http://bb.secdev.org/scapy/wiki/Home>`__.

For further information, you might want to read our published papers
about a TCP/IP stack written entirely in Dylan:

* :download:`A domain-specific language for manipulation of binary data in Dylan <../a-DSL-for-manipulation-of-binary-data.pdf>` (by Hannes Mehnert and Andreas Bogk at ILC 2007)
* :download:`Secure Networking <../secure-networking.pdf>` (by Andreas Bogk and Hannes Mehnert in 2006)
* :download:`A domain-specific language for manipulation of binary data in Dylan <../papers/a-DSL-for-manipulation-of-binary-data.pdf>` (by Hannes Mehnert and Andreas Bogk at ILC 2007)
* :download:`Secure Networking <../papers/secure-networking.pdf>` (by Andreas Bogk and Hannes Mehnert in 2006)

.. toctree::
:maxdepth: 3
Expand Down
8 changes: 5 additions & 3 deletions documentation/source/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ language instantiates these fields.

:keyword name: The name of this field.
:keyword fixup: A unary Dylan function computing the value of this field, used if no default is supplied and none provided by the client, defaults to ``#f``.
:keyword init-value: The default value if the client did not provide any, default :drm:`$unsupplied`.
:keyword init-value: The default value if the client did not provide any, default `$unsupplied <https://opendylan.org/library-reference/common-dylan/common-extensions.html#common-dylan:common-extensions:$unsupplied>`_.
:keyword static-end: A Dylan expression determining the end, defaults to :const:`$unknown-at-compile-time`.
:keyword static-length: A Dylan expression determining the length, defaults to :const:`$unknown-at-compile-time`.
:keyword static-start: A Dylan expression determining the start, defaults to :const:`$unknown-at-compile-time`.
Expand Down Expand Up @@ -958,11 +958,13 @@ Predefined Leaf Frames

.. class:: <unsigned-byte>

A single byte, represented as a :drm:`<byte>`.
A single byte, represented as a `<byte>
<https://opendylan.org/library-reference/common-dylan/byte-vector.html#common-dylan:byte-vector:[byte]>`_.

:operations:

- :gf:`high-level-type` returns :drm:`<byte>`.
- :gf:`high-level-type` returns `<byte>
https://opendylan.org/library-reference/common-dylan/byte-vector.html#common-dylan:byte-vector:[byte]`_.
- :gf:`field-size` returns 8.

:superclasses: :class:`<fixed-size-translated-leaf-frame>`
Expand Down
2 changes: 0 additions & 2 deletions documentation/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ Usage
.. current-library:: binary-data
.. current-module:: binary-data

.. contents::
:local:

Terminology
===========
Expand Down
15 changes: 15 additions & 0 deletions dylan-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"category": "parsers",
"contact": "[email protected]",
"description": "A DSL for parsing and assembling binary data",
"keywords": [ "binary", "parser" ],
"name": "binary-data",
"dependencies": [],
"dev-dependencies" : [
"testworks",
"sphinx-extensions"
],
"license": "MIT",
"url": "A DSL for parsing and assembling binary data",
"version": "0.1.1"
}
1 change: 0 additions & 1 deletion registry/generic/binary-data

This file was deleted.

1 change: 0 additions & 1 deletion registry/generic/binary-data-test

This file was deleted.

0 comments on commit cfbff10

Please sign in to comment.