Skip to content

Commit

Permalink
self-hosted
Browse files Browse the repository at this point in the history
  • Loading branch information
sosiristseng committed Mar 13, 2024
1 parent ceeb04c commit 8ca0278
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 38 deletions.
64 changes: 32 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ concurrency:

env:
NPROC: '2' # Number of Julia processes to run the notebooks
CACHE_NUM: '2'
CACHE_NUM: '1'
JULIA_CONDAPKG_BACKEND: 'Null'
JULIA_CI: 'true'
JULIA_NUM_THREADS: '2'
JULIA_CPU_TARGET: 'generic;znver3'
# JULIA_CPU_TARGET: 'generic'

jobs:
CI:
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -30,15 +30,15 @@ jobs:
id: cp
with:
python-version: '3.x'
- name: Cache pip dependencies
uses: actions/cache@v4
id: cache-py
with:
save-always: 'true'
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-pip-${{ steps.cp.outputs.python-version }}-${{ hashFiles('requirements.txt') }}
# - name: Cache pip dependencies
# uses: actions/cache@v4
# id: cache-py
# with:
# save-always: 'true'
# path: ${{ env.pythonLocation }}
# key: ${{ runner.os }}-pip-${{ steps.cp.outputs.python-version }}-${{ hashFiles('requirements.txt') }}
- name: Install pip dependencies if cache miss
if: ${{ steps.cache-py.outputs.cache-hit != 'true' }}
# if: ${{ steps.cache-py.outputs.cache-hit != 'true' }}
run: pip install -r requirements.txt
- name: Read Julia version
uses: SebRollen/[email protected]
Expand All @@ -50,39 +50,39 @@ jobs:
uses: julia-actions/setup-julia@v1
with:
version: ${{ steps.read_toml.outputs.value }}
- name: Restore Julia packages
uses: actions/cache/restore@v4
id: cache-julia
with:
path: |
~/.julia
!~/.julia/registries
key: ${{ runner.os }}-julia-${{ env.CACHE_NUM }}-${{ hashFiles('src/**', 'Project.toml', 'Manifest.toml' )}}
restore-keys: |
${{ runner.os }}-julia-${{ env.CACHE_NUM }}-
# - name: Restore Julia packages
# uses: actions/cache/restore@v4
# id: cache-julia
# with:
# path: |
# ~/.julia
# !~/.julia/registries
# key: ${{ runner.os }}-julia-${{ env.CACHE_NUM }}-${{ hashFiles('src/**', 'Project.toml', 'Manifest.toml' )}}
# restore-keys: |
# ${{ runner.os }}-julia-${{ env.CACHE_NUM }}-
- name: Install Julia packages
if: ${{ steps.cache-julia.outputs.cache-hit != 'true' }}
# if: ${{ steps.cache-julia.outputs.cache-hit != 'true' }}
env:
PYTHON: ${{ env.pythonLocation }}/python
run: julia --color=yes instantiate.jl
- name: Save Julia packages
uses: actions/cache/save@v4
if: ${{ steps.cache-julia.outputs.cache-hit != 'true' }}
with:
path: |
~/.julia
!~/.julia/registries
key: ${{ steps.cache-julia.outputs.cache-primary-key }}
# - name: Save Julia packages
# uses: actions/cache/save@v4
# if: ${{ steps.cache-julia.outputs.cache-hit != 'true' }}
# with:
# path: |
# ~/.julia
# !~/.julia/registries
# key: ${{ steps.cache-julia.outputs.cache-primary-key }}
- name: Cache literate notebooks
uses: actions/cache@v4
id: cache-nb
with:
path: |
docs/**/*.ipynb
docs/**/*.sha
key: ${{ steps.cache-julia.outputs.cache-primary-key }}-nb-${{ hashFiles('docs/**/*.jl') }}
key: ${{ hashFiles('src/**', 'Project.toml', 'Manifest.toml' )}}-nb-${{ hashFiles('docs/**/*.jl') }}
restore-keys: |
${{ steps.cache-julia.outputs.cache-primary-key }}-nb-
${{ hashFiles('src/**', 'Project.toml', 'Manifest.toml' )}}-nb-
- name: Run literate notebooks
if: ${{ steps.cache-nb.outputs.cache-hit != 'true' }}
run: julia --color=yes -p ${{ env.NPROC }} literate.jl
Expand Down
2 changes: 1 addition & 1 deletion instantiate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Pkg.add(["PrettyTables", "Literate"])
Pkg.activate(".")
Pkg.instantiate()
Pkg.precompile()
Pkg.gc(collect_delay=Day(0))
# Pkg.gc(collect_delay=Day(0))
6 changes: 1 addition & 5 deletions literate.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using Distributed
using PrettyTables
using SHA

@everywhere begin
ENV["GKSwstype"] = "100"
using Literate, Pkg
using Literate, Pkg, PrettyTables, SHA
Pkg.activate(Base.current_project())
end

Expand Down

0 comments on commit 8ca0278

Please sign in to comment.