Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions .github/workflows/docs-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ on:
pull_request:
push:
branches: [main]
# "Run workflow" in the Actions tab: runs the examples on every page.
workflow_dispatch:
inputs:
image:
description: Memgraph MAGE image (default is the newest release in the release notes)
required: false
default: ''

permissions:
contents: read
Expand All @@ -13,8 +20,8 @@ jobs:
name: Links, redirects and sidebar
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 22
- run: node scripts/check-docs.mjs
Expand All @@ -26,11 +33,24 @@ jobs:
if: github.event_name == 'pull_request' && github.base_ref == 'main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
with:
fetch-depth: 2
# The pages this PR changes: their Cypher examples run on the latest Memgraph, and the names in them are checked.
- run: python3 scripts/check-examples.py --base HEAD^1
env:
MEMGRAPH_ENTERPRISE_LICENSE: ${{ secrets.MEMGRAPH_ENTERPRISE_LICENSE }}
MEMGRAPH_ORGANIZATION_NAME: ${{ secrets.MEMGRAPH_ORGANIZATION_NAME }}

all-examples:
name: Examples and names on every page
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
- uses: actions/checkout@v7
- run: python3 scripts/check-examples.py --all ${IMAGE:+--image "$IMAGE"}
env:
IMAGE: ${{ inputs.image }}
MEMGRAPH_ENTERPRISE_LICENSE: ${{ secrets.MEMGRAPH_ENTERPRISE_LICENSE }}
MEMGRAPH_ORGANIZATION_NAME: ${{ secrets.MEMGRAPH_ORGANIZATION_NAME }}
5 changes: 3 additions & 2 deletions scripts/check-examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@ def message(r):
return EXPLAIN.get(r['kind'], r['kind']) + (f": {r['msg']}" if r['msg'] else '')


for title, rs, level in (('In the blocks this change touches', failing, 'error'),
whole = a.all or bool(a.pages)
for title, rs, level in (('Problems' if whole else 'In the blocks this change touches', failing, 'error'),
('Elsewhere on the changed pages (not failing)', others, 'warning')):
if not rs:
continue
Expand All @@ -482,5 +483,5 @@ def message(r):
with open(os.environ['GITHUB_STEP_SUMMARY'], 'a') as f:
f.write(scrub('\n'.join(summary)) + '\n')

print(f'\n{len(failing)} problem(s) in changed blocks, {len(others)} elsewhere on the changed pages.')
print(f'\n{len(failing)} problem(s).' if whole else f'\n{len(failing)} problem(s) in changed blocks, {len(others)} elsewhere on the changed pages.')
sys.exit(1 if failing else 0)
Loading