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
42 changes: 42 additions & 0 deletions .github/actions/arxiv-records/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: add the arXiv records
description: Unpack the arXiv records that manifests/records-arxiv.yaml pins from tamnd/math2-records (corpus arxiv AQ11).

inputs:
root:
description: The math2 tree.
default: .
m2:
description: An m2 with the command corpus records. With none, the action installs m2 v0.6.23, which has it. Go must be set up.
default: ""

runs:
using: composite
steps:
# The mentions of arXiv, the records of understand and the rows of the research layer are in tamnd/math2-records. The checks and the site read the tree with them, as the pipeline does.
- name: unpack the arXiv records
shell: bash
env:
ROOT: ${{ inputs.root }}
M2: ${{ inputs.m2 }}
run: |
pin="$ROOT/manifests/records-arxiv.yaml"
if [ ! -f "$pin" ]; then
echo "no pin of the arXiv records"
exit 0
fi
commit=$(sed -n 's/^commit: *//p' "$pin")
if ! printf '%s' "$commit" | grep -Eq '^[0-9a-f]{40}$'; then
echo "::error file=manifests/records-arxiv.yaml::the pin of the arXiv records is not a commit: $commit"
exit 1
fi
out="$RUNNER_TEMP/records-arxiv"
git init -q "$out"
git -C "$out" fetch -q --depth 1 https://github.com/tamnd/math2-records "$commit"
git -C "$out" checkout -q FETCH_HEAD
if [ -z "$M2" ]; then
GOBIN="$RUNNER_TEMP/m2-records" go install github.com/tamnd/math2-agent/cmd/m2@v0.6.23
M2="$RUNNER_TEMP/m2-records/m2"
fi
"$M2" corpus records unpack -root "$ROOT" -out "$out"
# The unpacked directories are not changes of the tree, so m2 audit -changed does not take them as new files.
printf '%s\n' /records/mentions/arxiv/ /records/understand/arxiv/ >> "$(git -C "$ROOT" rev-parse --git-path info/exclude)"
1 change: 1 addition & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
persist-credentials: false
fetch-depth: 0
- uses: ./.github/actions/m2
- uses: ./.github/actions/arxiv-records
- uses: ./.github/actions/lean
- name: m2 build
run: m2 build
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ jobs:
fetch-depth: 0
# The m2 version is in manifests/releases/next.yaml.
- uses: ./.github/actions/m2
- uses: ./.github/actions/arxiv-records
- name: m2 check
run: m2 check
# Each volume must pass the pack checks PC1 to PC10 of corpus K11.6. The check writes no file.
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/import.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,18 @@ jobs:
- name: build m2
working-directory: toolchain
run: go build -trimpath -o "$RUNNER_TEMP/m2" ./cmd/m2
- uses: ./content/.github/actions/arxiv-records
with:
root: content
m2: ${{ runner.temp }}/m2
# The import keeps the ids of the rows of the research layer, so it runs on the tree with the arXiv records. Then only the pin stays (corpus arxiv AQ11).
- name: m2 corpus import
working-directory: content
run: |
"$RUNNER_TEMP/m2" corpus import -plan corpus/plan.yaml -root . -commit "$GITHUB_SHA" -cache "$RUNNER_TEMP/cache" -summary "$RUNNER_TEMP/summary.md"
if [ -f manifests/records-arxiv.yaml ]; then
"$RUNNER_TEMP/m2" corpus records keep -root .
fi
- name: open and merge the pull request
working-directory: content
env:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ jobs:
- name: build m2
working-directory: toolchain
run: go build -trimpath -o "$RUNNER_TEMP/m2" ./cmd/m2
- uses: ./content/.github/actions/arxiv-records
with:
root: content
m2: ${{ runner.temp }}/m2
# The full catalogue of resources is in tamnd/math2-records at the commit of manifests/records.yaml (RS12.3). The site needs each resource, not only the tiers that math2 keeps.
- name: add the full catalogue
run: |
Expand Down Expand Up @@ -121,6 +125,10 @@ jobs:
- name: build m2
working-directory: toolchain
run: go build -trimpath -o "$RUNNER_TEMP/m2" ./cmd/m2
- uses: ./content/.github/actions/arxiv-records
with:
root: content
m2: ${{ runner.temp }}/m2
- name: build the site
env:
COMMIT: ${{ github.sha }}
Expand Down
10 changes: 10 additions & 0 deletions scripts/deploy-cloudflare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ fi

echo "$(date -u +%FT%TZ) deploy math2 $content, math2-agent $toolchain, wikipedia-math $wikipedia"
(cd "$dir/toolchain" && go build -trimpath -o "$dir/m2" ./cmd/m2)
# The arXiv records are in tamnd/math2-records at the commit of manifests/records-arxiv.yaml (corpus arxiv AQ11). The site reads the tree with them. The records of an earlier deploy go first, since unpack adds nothing to a tree that has them.
recpin=$(sed -n 's/^commit: *//p' "$dir/content/manifests/records-arxiv.yaml" 2>/dev/null || true)
if [ -n "$recpin" ]; then
git -C "$dir/content" clean -fdq records
git -C "$dir/content" checkout -q -- records
[ -d "$dir/records-arxiv/.git" ] || git init -q "$dir/records-arxiv"
git -C "$dir/records-arxiv" fetch -q --depth 1 https://github.com/tamnd/math2-records "$recpin"
git -C "$dir/records-arxiv" checkout -q -f FETCH_HEAD
"$dir/m2" corpus records unpack -root "$dir/content" -out "$dir/records-arxiv"
fi
rm -rf "$dir/site"
GOMEMLIMIT=${M2_BUILD_MEMORY:-2GiB} "$dir/m2" site build -content "$dir/content" -spec "$dir/toolchain/spec" -wikipedia "$dir/wikipedia" -out "$dir/site" -url "$url" -commit "$content" -date now -cloudflare -cache "$dir/cache/math.gob.gz" -social-packs "$dir/social-packs"
files=$(find "$dir/site" -type f | wc -l)
Expand Down
Loading