Parse Markdown and Generate JSON workflow (DmitryRyumin/ICCV-2023-25-Papers)
The Parse Markdown and Generate JSON workflow from DmitryRyumin/ICCV-2023-25-Papers, explained and optimized by Latchkey.
CI health: C - fair
Point runs-on at Latchkey and get caching, job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the Parse Markdown and Generate JSON workflow from the DmitryRyumin/ICCV-2023-25-Papers repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: Parse Markdown and Generate JSON
on:
schedule:
- cron: '0 0 * * *' # 00:00 UTC
workflow_dispatch:
jobs:
parse_markdown:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.10.11
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install bs4 markdown2 prettytable PyGithub flake8 black
continue-on-error: true
- name: Run Flake8 (Linting)
run: flake8 code/
- name: Check code formatting
run: black --check code/
- name: Run Markdown Parser
id: parse
run: python code/markdown_to_json_parser.py
working-directory: ${{ github.workspace }}
continue-on-error: true
env:
PAPER_TOKEN: ${{ secrets.PAPER_TOKEN }}
- name: Upload JSON files
uses: actions/upload-artifact@v4
with:
name: json_data
path: ${{ github.workspace }}/json_data
- name: Set output status
run: echo "status=${{ steps.parse.outcome }}" >> $GITHUB_ENV
The same workflow, on Latchkey
Estimated ~20% faster on cache hits, plus fewer wasted runs and a safer supply chain. Added and changed lines are highlighted.
name: Parse Markdown and Generate JSON on: schedule: - cron: '0 0 * * *' # 00:00 UTC workflow_dispatch: jobs: parse_markdown: timeout-minutes: 30 runs-on: latchkey-small steps: - name: Checkout repository uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: 3.10.11 - name: Install Node.js uses: actions/setup-node@v4 with: cache: 'npm' node-version: '20' - name: Install dependencies run: | python -m pip install --upgrade pip pip install bs4 markdown2 prettytable PyGithub flake8 black continue-on-error: true - name: Run Flake8 (Linting) run: flake8 code/ - name: Check code formatting run: black --check code/ - name: Run Markdown Parser id: parse run: python code/markdown_to_json_parser.py working-directory: ${{ github.workspace }} continue-on-error: true env: PAPER_TOKEN: ${{ secrets.PAPER_TOKEN }} - name: Upload JSON files uses: actions/upload-artifact@v4 with: name: json_data path: ${{ github.workspace }}/json_data - name: Set output status run: echo "status=${{ steps.parse.outcome }}" >> $GITHUB_ENV
What changed
- Run on Latchkey managed runners with one line (
runs-on), which apply the fixes below automatically and self-heal transient failures. This example useslatchkey-small; pick the runner size that fits the job. - Cache dependency installs on the setup step so they are served from cache.
- Add a job timeout so a hung step cannot burn hours of runner time.
What Latchkey heals here
This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:
- Dependency installs
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.