Skip to content

Verify MDX Content 🔍 #43

Verify MDX Content 🔍

Verify MDX Content 🔍 #43

name: Verify MDX Content
on:
workflow_dispatch:
inputs:
pr_id:
description: 'Pull Request ID'
required: true
# workflow_run:
# workflows: ["Verify formatting"]
# types:
# - completed
jobs:
verification:
permissions:
checks: write
issues: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# with:
# ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/cache/restore@v4
id: prepyrus-cache-restore
with:
path: target/release/prepyrus
key: ${{ runner.os }}-cargo-${{ hashFiles('scripts/prepyrus/Cargo.lock') }}-${{ hashFiles('scripts/prepyrus/src/**') }}
- name: Install Rust
if: steps.prepyrus-cache-restore.outputs.cache-hit != 'true'
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install dependencies
if: steps.prepyrus-cache-restore.outputs.cache-hit != 'true'
run: cargo build --release --package prepyrus
- name: Run prepyrus script in verification mode
id: prepyrus-run
run: target/release/prepyrus absolute_bibliography.bib src/pages verify
- name: Save Prepyrus to cache
id: prepyrus-cache-save
if: steps.prepyrus-cache-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: target/release/prepyrus
key: ${{ runner.os }}-cargo-${{ hashFiles('scripts/prepyrus/Cargo.lock') }}-${{ hashFiles('scripts/prepyrus/src/**') }}
- name: Report tests check
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.checks.create({
name: 'prepyrus verification',
head_sha: '${{ github.event.inputs.pr_id }}',
status: 'completed',
conclusion: '${{ steps.prepyrus-run.outcome }}',
output: {
title: 'Prepyrus verification',
summary: 'Results: ${{ steps.prepyrus-run.outcome }}'
},
owner: context.repo.owner,
repo: context.repo.repo
})
if: always()
# To include multiple paths for the cache:
# path: |
# ~/.cargo/bin/
# ~/.cargo/registry/index/
# ~/.cargo/registry/cache/
# ~/.cargo/git/db/
# target/