Skip to content

Commit 71a7a60

Browse files
authored
Call Pkg.resolve() before hashing Manifest (#519)
* Update Manifest * Call resolve() in preview/publish workflows Closes #518 * Add GHA workflow to resolve Manifest file * Prefix cache path with `./` cf. actions/cache#1361
1 parent 3143ffb commit 71a7a60

File tree

4 files changed

+58
-8
lines changed

4 files changed

+58
-8
lines changed

.github/workflows/preview.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ jobs:
2222
with:
2323
version: '1.10'
2424

25+
# Note: needs resolve() to fix #518
2526
- name: Instantiate Julia environment
26-
run: julia --project=. -e 'using Pkg; Pkg.instantiate()'
27+
run: julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.resolve()'
2728

2829
- name: Set up Quarto
2930
uses: quarto-dev/quarto-actions/setup@v2
@@ -33,7 +34,7 @@ jobs:
3334
uses: actions/cache/restore@v4
3435
with:
3536
path: |
36-
_freeze/
37+
./_freeze/
3738
key: ${{ runner.os }}-${{ hashFiles('**/Manifest.toml') }}
3839

3940
- name: Render Quarto site
@@ -44,7 +45,7 @@ jobs:
4445
uses: actions/cache/save@v4
4546
with:
4647
path: |
47-
_freeze/
48+
./_freeze/
4849
key: ${{ runner.os }}-${{ hashFiles('**/Manifest.toml') }}
4950

5051
- name: Deploy to GitHub Pages

.github/workflows/publish.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ jobs:
2020
with:
2121
version: '1.10'
2222

23+
# Note: needs resolve() to fix #518
2324
- name: Instantiate Julia environment
24-
run: julia --project=. -e 'using Pkg; Pkg.instantiate()'
25+
run: julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.resolve()'
2526

2627
- name: Set up Quarto
2728
uses: quarto-dev/quarto-actions/setup@v2
@@ -34,7 +35,7 @@ jobs:
3435
uses: actions/cache/restore@v4
3536
with:
3637
path: |
37-
_freeze/
38+
./_freeze/
3839
key: ${{ runner.os }}-${{ hashFiles('**/Manifest.toml') }}
3940

4041
- name: Extract version from _quarto.yml
@@ -75,7 +76,7 @@ jobs:
7576
uses: actions/cache/save@v4
7677
with:
7778
path: |
78-
_freeze/
79+
./_freeze/
7980
key: ${{ runner.os }}-${{ hashFiles('**/Manifest.toml') }}
8081

8182
- name: Fetch search_original.json from main site
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# This action runs Pkg.instantiate() and Pkg.resolve() every time the master
2+
# branch is pushed to. If this leads to a change in the Manifest.toml file, it
3+
# will open a PR to update the Manifest.toml file. This ensures that the
4+
# contents of the Manifest in the repository are consistent with the contents
5+
# of the Manifest used by the CI system (i.e. during the actual docs
6+
# generation).
7+
#
8+
# See https://github.com/TuringLang/docs/issues/518 for motivation.
9+
10+
name: Resolve Manifest
11+
on:
12+
push:
13+
branches:
14+
- master
15+
workflow_dispatch:
16+
17+
jobs:
18+
check-version:
19+
runs-on: ubuntu-latest
20+
21+
permissions:
22+
contents: write
23+
pull-requests: write
24+
25+
env:
26+
# Disable precompilation as it takes a long time and is not needed for this workflow
27+
JULIA_PKG_PRECOMPILE_AUTO: 0
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Setup Julia
34+
uses: julia-actions/setup-julia@v2
35+
36+
- name: Instantiate and resolve
37+
run: |
38+
julia -e 'using Pkg; Pkg.instantiate(); Pkg.resolve()'
39+
40+
- name: Open PR
41+
id: create_pr
42+
uses: peter-evans/create-pull-request@v6
43+
with:
44+
branch: resolve-manifest
45+
add-paths: Manifest.toml
46+
commit-message: "Update Manifest.toml"
47+
body: "This PR is automatically generated by the `resolve_manifest.yml` GitHub Action."
48+
title: "Update Manifest.toml to match CI environment"

Manifest.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is machine-generated - editing it directly is not advised
22

3-
julia_version = "1.10.4"
3+
julia_version = "1.10.5"
44
manifest_format = "2.0"
55
project_hash = "e0661388214f9e03749b3fccc86939dfd3853246"
66

@@ -3328,7 +3328,7 @@ version = "0.15.2+0"
33283328
[[deps.libblastrampoline_jll]]
33293329
deps = ["Artifacts", "Libdl"]
33303330
uuid = "8e850b90-86db-534c-a0d3-1478176c7d93"
3331-
version = "5.8.0+1"
3331+
version = "5.11.0+0"
33323332

33333333
[[deps.libdecor_jll]]
33343334
deps = ["Artifacts", "Dbus_jll", "JLLWrappers", "Libdl", "Libglvnd_jll", "Pango_jll", "Wayland_jll", "xkbcommon_jll"]

0 commit comments

Comments
 (0)