docs(blog): post disclaimer #2627
Workflow file for this run
This file contains hidden or 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
| # documentation: https://help.github.com/en/articles/workflow-syntax-for-github-actions | |
| name: build documentation | |
| on: [push, pull_request] | |
| # Declare default permissions as read only. | |
| permissions: read-all | |
| jobs: | |
| build: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
| - name: set up Python | |
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version: '3.10' | |
| - name: Codespell action | |
| uses: codespell-project/actions-codespell@22ff5a2e4b591290baf82d47c9feadac31c65441 # v1.0 | |
| with: | |
| check_filenames: true | |
| # MarkDown files in docs/available_software/detail are skipped because they are auto-generated | |
| skip: '*.pdf,.git,*.json,./docs/available_software/detail/*.md,./docs/available_software_riscv/detail/*.md' | |
| ignore_words_list: Fram,fram,ND,nd,Linz | |
| # - name: Markdown Linting Action | |
| # uses: avto-dev/markdown-lint@v1.2.0 | |
| # with: | |
| # rules: '/lint/rules/changelog.js' | |
| # config: '/lint/config/changelog.yml' | |
| # args: '.' | |
| # Make sure to also test deployment of auto-generated API docs for test suite | |
| # For that, we need the repo to be available under eessi/test-suite | |
| - name: checkout test suite | |
| uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
| with: | |
| repository: eessi/test-suite | |
| # Path is needed, otherwise this will overwrite the checkout action that cloned the docs repo | |
| path: test-suite/test-suite | |
| - name: Generate docs for latest release | |
| run: | | |
| cd test-suite/test-suite | |
| # Make sure to fetch tags, so we can checkout a particular release | |
| git fetch --tags | |
| # This assumes we stick to a version-tagging scheme vX.Y.Z | |
| LATEST_VERSION=$(git tag | grep '^v[0-9]\+\.[0-9]\+\.[0-9]\+$' | sort -t. -k 1,1n -k 2,2n -k 3,3n | tail -1) | |
| # Use the latest release by default | |
| git checkout $LATEST_VERSION | |
| git branch | |
| - name: install mkdocs + plugins | |
| run: | | |
| pip install -r requirements.txt | |
| pip list | grep mkdocs | |
| mkdocs --version | |
| - name: build tutorial | |
| run: make test | |
| # The disclaimer is injected by overrides/partials/copyright.html, which | |
| # depends on mkdocs-material including that partial in the page footer. A | |
| # theme update that drops the include leaves the build green but silently | |
| # removes the disclaimer, so assert it reaches every rendered post. | |
| - name: check blog post disclaimer is rendered | |
| run: | | |
| posts=$(find site/blog -name index.html | grep -cE "/blog/20[0-9]{2}/[0-9]{2}/[0-9]{2}/") | |
| marked=$(grep -rl data-eessi-blog-disclaimer site/blog --include=index.html | grep -cE "/blog/20[0-9]{2}/[0-9]{2}/[0-9]{2}/") | |
| echo "blog posts: $posts, with disclaimer: $marked" | |
| test "$posts" -gt 0 | |
| test "$posts" -eq "$marked" |