Skip to content

Commit

Permalink
run natively
Browse files Browse the repository at this point in the history
  • Loading branch information
sosiristseng committed Nov 2, 2023
1 parent e12e860 commit bec2a20
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 14 deletions.
46 changes: 33 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,29 @@ env:
EXTRA_ARGS: '' # Extra arguments for nbconvert
PYTHON_VER: '3.11'
JULIA_CPU_TARGET: 'generic;haswell,clone_all'
JULIA_NUM_THREADS: auto
JULIA_NUM_THREADS: 'auto'
JULIA_CONDAPKG_BACKEND: 'Null'
JULIA_CI: 'true'

jobs:
setup:
runs-on: ubuntu-latest
container:
image: julia:1.9.3
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
- name: Read Julia version
uses: SebRollen/[email protected]
id: read_toml
with:
python-version: ${{ env.PYTHON_VER }}
file: 'Manifest.toml'
field: 'julia_version'
- name: Install Julia using jill.sh
run: |
wget -O /tmp/jill.sh https://raw.githubusercontent.com/abelsiqueira/jill/main/jill.sh
bash /tmp/jill.sh --version ${{ steps.read_toml.outputs.value }} -y
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Cache Julia deps
uses: actions/cache@v3
with:
Expand All @@ -43,9 +48,13 @@ jobs:
~/.julia/packages
~/.julia/environments
~/.local/share/jupyter/
key: ${{ runner.os }}-juliacontainer-${{ hashFiles('src/**','Project.toml', 'Manifest.toml')}}
key: ${{ runner.os }}-jill-${{ hashFiles('src/**','Project.toml', 'Manifest.toml')}}
restore-keys: |
${{ runner.os }}-juliacontainer-
${{ runner.os }}-jill-
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VER }}
- name: Install Julia deps
env:
PYTHON: ${{ env.pythonLocation }}/python
Expand Down Expand Up @@ -73,8 +82,6 @@ jobs:
# Notebooks need to be executed
notebook: ${{ fromJSON(needs.setup.outputs.matrix) }}
runs-on: ubuntu-latest
container:
image: julia:1.9.3
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -85,11 +92,26 @@ jobs:
path: docs/${{ matrix.notebook }}
key: ${{ runner.os }}-notebook-${{ hashFiles(format('docs/{0}', matrix.notebook), 'src/**', 'Project.toml', 'Manifest.toml') }}
- name: Setup Python
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VER }}
- name: Install Python deps
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: python -m pip install --no-cache-dir nbconvert -r requirements.txt
- name: Read Julia version
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
uses: SebRollen/[email protected]
id: read_toml
with:
file: 'Manifest.toml'
field: 'julia_version'
- name: Install Julia using jill.sh
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: |
wget -O /tmp/jill.sh https://raw.githubusercontent.com/abelsiqueira/jill/main/jill.sh
bash /tmp/jill.sh --version ${{ steps.read_toml.outputs.value }} -y
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Cache Julia deps
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
uses: actions/cache@v3
Expand All @@ -100,9 +122,7 @@ jobs:
~/.julia/packages
~/.julia/environments
~/.local/share/jupyter/
key: ${{ runner.os }}-juliacontainer-${{ hashFiles('src/**','Project.toml', 'Manifest.toml', 'requirements.txt')}}
restore-keys: |
${{ runner.os }}-juliacontainer-
key: ${{ runner.os }}-juliacontainer-${{ hashFiles('src/**','Project.toml', 'Manifest.toml')}}
- name: Execute Notebook
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: >
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/update-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ concurrency:

env:
APP_ID: '189113' # https://github.com/apps/wen-wei-s-pr-bot
JULIA_PKG_PRECOMPILE_AUTO: '0'

jobs:
update-manifest:
Expand All @@ -30,6 +29,8 @@ jobs:
- name: Setup Julia
uses: julia-actions/setup-julia@v1
- name: Update Julia dependencies
env:
JULIA_PKG_PRECOMPILE_AUTO: '0'
run: julia --color=yes --project=@. -e 'import Pkg; Pkg.update()'
# Authenticate with a custom GitHub APP
# https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#authenticating-with-github-app-generated-tokens
Expand Down

0 comments on commit bec2a20

Please sign in to comment.