summary refs log tree commit diff
path: root/.github/workflows/manual-rendering.yml
blob: f54553049bb77b5d8a44c455e9c58a898fc6cb04 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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:
      pull-requests: write  # for peter-evans/create-or-update-comment to create or update comment
    if: github.repository_owner == 'NixOS'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: cachix/install-nix-action@v19
        with:
          # explicitly enable sandbox
          extra_nix_config: sandbox = true
          install_url: https://releases.nixos.org/nix/nix-2.13.3/install
      - uses: cachix/cachix-action@v12
        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: |
          export NIX_PATH=nixpkgs=$(pwd)
          .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
        uses: peter-evans/create-or-update-comment@v2
        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.