Skip to content

Commit 032f015

Browse files
authored
Add upstreaming dashboard generation (#77)
Add a workflow and supporting files to generate a GitHub Page with an upstreaming dashboard, powered by the queueboard and the [upstreaming-dashboard-action](https://github.com/leanprover-community/upstreaming-dashboard-action). Updates README with instructions on how to set this up
1 parent 445179e commit 032f015

5 files changed

Lines changed: 97 additions & 0 deletions

File tree

.github/workflows/deploy-pages.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Build and Deploy Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
schedule:
9+
- cron: '0 6 * * *'
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: github-pages
14+
cancel-in-progress: true
15+
16+
permissions:
17+
contents: read
18+
pages: write
19+
id-token: write
20+
21+
jobs:
22+
build-pages:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout project
26+
uses: actions/checkout@v6
27+
28+
# See https://github.com/leanprover-community/upstreaming-dashboard-action
29+
# for more details on how this action works and its parameters
30+
- name: Generate upstream dashboard snippets
31+
uses: leanprover-community/upstreaming-dashboard-action@e3ee7dc54fd376f093ef62973d7b04cf7beabad0
32+
with:
33+
website-directory: website
34+
project-name: Project
35+
branch-name: ${{ github.event.repository.default_branch }}
36+
# include-drafts: false # Include draft PRs in the dashboard?
37+
# relevant-labels: "label1,label2" # Group PRs by 'relevant' based on these labels
38+
39+
- name: Configure Pages
40+
uses: actions/configure-pages@v5
41+
42+
- name: Build with Jekyll
43+
uses: actions/jekyll-build-pages@v1
44+
with:
45+
source: website
46+
destination: ./_site
47+
48+
- name: Upload Pages artifact
49+
uses: actions/upload-pages-artifact@v4
50+
with:
51+
path: ./_site
52+
53+
deploy-pages:
54+
runs-on: ubuntu-latest
55+
needs: build-pages
56+
environment:
57+
name: github-pages
58+
url: ${{ steps.deployment.outputs.page_url }}
59+
steps:
60+
- name: Deploy to GitHub Pages
61+
id: deployment
62+
uses: actions/deploy-pages@v4

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ To set up GitHub Pages for your repository, follow these steps:
6161
2. In the left sidebar, click on the **Pages** section.
6262
3. In the **Source** dropdown, select `GitHub Actions`.
6363
64+
The workflow [`deploy-pages.yml`](.github/workflows/deploy-pages.yml) builds the Jekyll site in
65+
[`website`](website), runs the
66+
[`upstreaming-dashboard-action`](https://github.com/leanprover-community/upstreaming-dashboard-action),
67+
and deploys the result to GitHub Pages.
68+
6469
## Repository Layout
6570
6671
The template repository is organized as follows (listing the main folders and files):
@@ -73,6 +78,8 @@ The template repository is organized as follows (listing the main folders and fi
7378
and can be manually disabled by clicking on the **Actions** tab, selecting **Build Project**
7479
in the left sidebar, then clicking the horizontal triple dots (⋯) on the right,
7580
and choosing **Disable workflow**.
81+
- [`deploy-pages.yml`](.github/workflows/deploy-pages.yml) defines the workflow for building
82+
and deploying the GitHub Pages site, including generation of the upstreaming dashboard.
7683
- [`create-release.yml`](.github/workflows/create-release.yml): defines the workflow for creating a new Git tag and GitHub release when the `lean-toolchain` file is updated in the `main` branch. Ensure the following settings are configured under **Settings > Actions > General > Workflow permissions**: "Read and write permissions" and "Allow GitHub Actions to create and approve pull requests".
7784
- [`update.yml`](.github/workflows/update.yml) is the dependency
7885
update workflow to be triggered manually by default. [It's not documented yet, but it will be soon.]
@@ -86,6 +93,8 @@ The template repository is organized as follows (listing the main folders and fi
8693
- [`Example.lean`](Project/Example.lean) is a sample Lean file.
8794
- [`scripts`](scripts) contains scripts to update Mathlib ensuring that the latest version is
8895
fetched and integrated into the development environment.
96+
- [`website`](website) contains the Jekyll files for the GitHub Pages homepage that displays the
97+
upstreaming dashboard.
8998
- [`.gitignore`](.gitignore) specifies files and folders to be ignored by Git.
9099
and environment.
91100
- [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md) should contain the code of conduct for the project.

scripts/customize_template.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,17 @@ def main(project_name):
4949
lakefile_toml = 'lakefile.toml'
5050
project_lean = 'Project.lean'
5151
build_project_yml = '.github/workflows/build-project.yml'
52+
deploy_pages_yml = '.github/workflows/deploy-pages.yml'
5253
citation_bib = 'CITATION.bib'
54+
website_config = 'website/_config.yml'
55+
website_index = 'website/index.md'
5356

5457
# Replace 'Project' with the actual project name in the necessary files
5558
replace_text_in_file(lakefile_toml, 'Project', project_name)
5659
replace_text_in_file(build_project_yml, 'Project', project_name)
60+
replace_text_in_file(deploy_pages_yml, 'Project', project_name)
61+
replace_text_in_file(website_config, 'Project', project_name)
62+
replace_text_in_file(website_index, 'Project', project_name)
5763

5864
# Rename 'Project' folder to match the project name
5965
rename_directory(project_folder, project_name)

website/_config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
title: Project
2+
description: Upstreaming dashboard for Project
3+
theme: minima
4+
markdown: kramdown

website/index.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
layout: default
3+
title: Upstreaming Dashboard
4+
---
5+
6+
<header class="page-header">
7+
<h1>{{ site.title }}</h1>
8+
</header>
9+
10+
This project will typically want to contribute some files into `Mathlib` itself. These files, which we can call 'upstreaming candidates', exist in this repository while they are being developed. This dashboard shows upstreaming candidates that look ready to ingest into `Mathlib`, and also files in the project that look "easy to unlock" for upstreaming.
11+
12+
For the dashboard to be correct, the repository must follow the same directory and filename structure as Mathlib for their upstreaming candidates. Namely, the upstream candidate `A/B/C.lean`, should exist in `Mathlib/A/B/C.lean`.
13+
14+
The dashboard highlights any open PRs to the Mathlib repository containing the corresponding files.
15+
16+
{% include _upstreaming_dashboard/dashboard.md %}

0 commit comments

Comments
 (0)