Skip to content

Commit

Permalink
CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sosiristseng committed Sep 15, 2024
1 parent 749bd20 commit 4849bca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ concurrency:
cancel-in-progress: true

env:
NBCONVERT_JOBS: '4'
NBCONVERT_JOBS: '3'
LITERATE_PROC: '3'
ALLOWERRORS: 'false'
CACHE_NUM: '2'
JULIA_CONDAPKG_BACKEND: 'Null'
JULIA_CI: 'true'
NBCACHE: '.cache'
Expand Down Expand Up @@ -46,7 +45,7 @@ jobs:
id: hash
run: |
echo "value=${{ hashFiles('Project.toml', 'Manifest.toml', 'src/**') }}" >> "$GITHUB_OUTPUT"
echo "ver=${{ runner.os }}-julia-${{ env.CACHE_NUM }}-${{ steps.read_toml.outputs.value }}" >> "$GITHUB_OUTPUT"
echo "ver=${{ runner.os }}-julia-${{ steps.read_toml.outputs.value }}" >> "$GITHUB_OUTPUT"
- name: Cache executed notebooks
uses: actions/cache@v4
id: cache-nb
Expand All @@ -61,7 +60,7 @@ jobs:
version: ${{ steps.read_toml.outputs.value }}
- name: Restore Julia packages
uses: actions/cache/restore@v4
if: ${{ runner.environment == 'github-hosted' }}
if: ${{ runner.environment == 'github-hosted'}}
id: cache-julia
with:
path: ~/.julia
Expand All @@ -72,7 +71,7 @@ jobs:
if: ${{ runner.environment == 'self-hosted' || steps.cache-julia.outputs.cache-hit != 'true' }}
shell: julia --color=yes {0}
run: |
using Pkg, Dates
using Pkg
Pkg.add(["IJulia", "Literate", "PrettyTables", "JSON"])
Pkg.activate(".")
Pkg.instantiate()
Expand All @@ -85,7 +84,7 @@ jobs:
key: ${{ steps.cache-julia.outputs.cache-primary-key }}
- name: Run notebooks
if: ${{ steps.cache-nb.outputs.cache-hit != 'true' }}
run: julia --color=yes -p ${{ env.LITERATE_PROC }} --heap-size-hint=3G run.jl
run: julia --project=@. --color=yes -p ${{ env.LITERATE_PROC }} run.jl
- name: Copy back built notebooks
run: cp --verbose -rf ${{ env.NBCACHE }}/docs/* docs/
- name: Build website
Expand Down
5 changes: 1 addition & 4 deletions run.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ using IJulia
@everywhere begin
ENV["GKSwstype"] = "100"
using Literate, Pkg, JSON
Pkg.activate(Base.current_project())
end

# Strip SVG output from a Jupyter notebook
Expand Down Expand Up @@ -100,9 +99,7 @@ function main(;
ts_lit = pmap(litnbs; on_error=ex -> NaN) do nb
@elapsed run_literate(nb, cachedir; rmsvg)
end

# Remove worker processes to release some memory
rmprocs(workers())
rmprocs(workers()) # Remove worker processes to release some memory

# Debug notebooks one by one if there are errors
for (nb, t) in zip(litnbs, ts_lit)
Expand Down

0 comments on commit 4849bca

Please sign in to comment.