Skip to content

Commit

Permalink
CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sosiristseng committed Nov 2, 2023
1 parent 04a22ee commit d2834f6
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 37 deletions.
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
open-pull-requests-limit: 1
schedule:
interval: daily
labels:
- automerge
- package-ecosystem: github-actions
directory: "/"
open-pull-requests-limit: 1
schedule:
interval: daily
labels:
- automerge
57 changes: 30 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,29 @@ concurrency:
env:
NPROC: '2' # Number of Julia processes to run the notebooks
PYTHON_VER: '3.11'
JULIA_CPU_TARGET: 'generic;haswell,clone_all'
JULIA_NUM_THREADS: 'auto'
JULIA_CONDAPKG_BACKEND: 'Null'
JULIA_CI: 'true'
GKSwstype: '100'

jobs:
execute:
runs-on: ubuntu-latest
container:
image: julia:1.9.3
env:
JULIA_CPU_TARGET: 'generic;haswell,clone_all'
JULIA_NUM_THREADS: auto
JULIA_CONDAPKG_BACKEND: 'Null'
JULIA_CI: 'true'
GKSwstype: '100' # Null GR backend for Plots.jl
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 }}
- name: Install Python deps
run: python -m pip install --no-cache-dir -r requirements.txt
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,16 +45,24 @@ jobs:
~/.julia/compiled
~/.julia/packages
~/.julia/environments
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
id: python3
with:
python-version: ${{ env.PYTHON_VER }}
cache: 'pip'
- name: Install Python deps
run: python -m pip install -r requirements.txt
- name: Install Julia deps
env:
PYTHON: ${{ env.pythonLocation }}/python
JULIA_PYTHONCALL_EXE: ${{ env.pythonLocation }}/python
PYTHON: ${{ steps.python3.outputs.python-path }}
JULIA_PYTHONCALL_EXE: ${{ steps.python3.outputs.python-path }}
run: |
julia --color=yes -e 'using Pkg; Pkg.add(["PrettyTables", "Literate"])'
julia --project=@. --color=yes -e 'using Pkg; Pkg.activate("."); Pkg.instantiate(); Pkg.gc()'
julia --project=@. --color=yes -e 'using Pkg; Pkg.instantiate(); Pkg.gc()'
- name: Run program
env:
JULIA_PROJECT: '@.'
Expand All @@ -67,9 +77,6 @@ jobs:
render:
needs: execute
runs-on: ubuntu-latest
# store success output flag for the ci job
outputs:
success: ${{ steps.setoutput.outputs.success }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -103,18 +110,14 @@ jobs:
run: echo "success=true" >> $GITHUB_OUTPUT

# CI conclusion for GitHub status check
# https://brunoscheufler.com/blog/2022-04-09-the-required-github-status-check-that-wasnt
# Adaped from https://brunoscheufler.com/blog/2022-04-09-the-required-github-status-check-that-wasnt
CI:
needs: render
if: always()
runs-on: ubuntu-latest
steps:
# pass step only when output of previous jupyter-book job is set
# in case at least one of the execution fails, jupyter-book is skipped
# and the output will not be set, which will then cause the ci job to fail
- run: |
passed="${{ needs.render.outputs.success }}"
if [[ $passed == "true" ]]; then
if [[ ${{ needs.render.result }} == "success" ]]; then
echo "Tests passed"
exit 0
else
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
9 changes: 0 additions & 9 deletions renovate.json

This file was deleted.

0 comments on commit d2834f6

Please sign in to comment.