2022-09-03 16:35:28 +02:00
|
|
|
name: "Check NixOS Manual DocBook rendering against MD rendering"
|
|
|
|
|
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
# * is a special character in YAML so you have to quote this string
|
|
|
|
# Check every 24 hours
|
|
|
|
- cron: '0 0 * * *'
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
check-rendering-equivalence:
|
|
|
|
permissions:
|
2022-09-11 09:01:47 +02:00
|
|
|
pull-requests: write # for peter-evans/create-or-update-comment to create or update comment
|
2022-09-03 16:35:28 +02:00
|
|
|
if: github.repository_owner == 'NixOS'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2023-03-01 07:15:21 +01:00
|
|
|
- uses: cachix/install-nix-action@v20
|
2022-09-03 16:35:28 +02:00
|
|
|
with:
|
|
|
|
# explicitly enable sandbox
|
|
|
|
extra_nix_config: sandbox = true
|
2022-10-28 01:30:20 +02:00
|
|
|
- uses: cachix/cachix-action@v12
|
2022-09-03 16:35:28 +02:00
|
|
|
with:
|
|
|
|
# This cache is for the nixpkgs repo checks and should not be trusted or used elsewhere.
|
|
|
|
name: nixpkgs-ci
|
|
|
|
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
|
|
|
|
|
|
|
- name: Build DocBook and MD manuals
|
|
|
|
run: |
|
|
|
|
export NIX_PATH=nixpkgs=$(pwd)
|
|
|
|
nix-build \
|
|
|
|
--option restrict-eval true \
|
|
|
|
-o docbook nixos/release.nix \
|
|
|
|
-A manual.x86_64-linux
|
|
|
|
nix-build \
|
|
|
|
--option restrict-eval true \
|
|
|
|
--arg configuration '{ documentation.nixos.options.allowDocBook = false; }' \
|
|
|
|
-o md nixos/release.nix \
|
|
|
|
-A manual.x86_64-linux
|
|
|
|
|
|
|
|
- name: Compare DocBook and MD manuals
|
|
|
|
id: check
|
|
|
|
run: |
|
2022-09-11 03:08:01 +02:00
|
|
|
export NIX_PATH=nixpkgs=$(pwd)
|
2022-09-03 16:35:28 +02:00
|
|
|
.github/workflows/compare-manuals.sh \
|
|
|
|
docbook/share/doc/nixos/options.html \
|
|
|
|
md/share/doc/nixos/options.html
|
|
|
|
|
|
|
|
# if the manual can't be built we don't want to notify anyone.
|
|
|
|
# while this may temporarily hide rendering failures it will be a lot
|
|
|
|
# less noisy until all nixpkgs pull requests have stopped using
|
|
|
|
# docbook for option docs.
|
|
|
|
- name: Comment on failure
|
2023-04-10 14:00:14 +02:00
|
|
|
uses: peter-evans/create-or-update-comment@v3
|
2022-09-03 16:35:28 +02:00
|
|
|
if: ${{ failure() && steps.check.conclusion == 'failure' }}
|
|
|
|
with:
|
|
|
|
issue-number: 189318
|
|
|
|
body: |
|
|
|
|
Markdown and DocBook manuals do not agree.
|
|
|
|
|
|
|
|
Check https://github.com/NixOS/nixpkgs/actions/runs/${{ github.run_id }} for details.
|