Skip to content

Commit

Permalink
MAINT: outsource to Lc2ppiKSemileptonicModelLHCb.jl (#326)
Browse files Browse the repository at this point in the history
* DX: install `juliaup` in Conda environment
* DX: run all Julia scripts in GitHub Actions
* ENH: improve Julia cache for GitHub Actions
* FIX: use correct `Manifest.toml` path
* MAINT: update `actions/checkout`
* MAINT: update Julia dependencies

---------

Co-authored-by: Mikhail Mikhasenko <[email protected]>
  • Loading branch information
redeboer and mmikhasenko authored Dec 15, 2023
1 parent f5d173c commit 274de39
Show file tree
Hide file tree
Showing 23 changed files with 1,617 additions and 1,136 deletions.
2 changes: 2 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,12 @@
"cmin",
"commitlint",
"einsum",
"exportnotebooks",
"hangle",
"iminuit",
"ipynb",
"isfinite",
"juliaup",
"lc2pkpi",
"mathbf",
"mathrm",
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: Build HTML (fast)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ComPWA/actions/pip-install@v1
with:
additional-packages: tox
Expand All @@ -34,7 +34,7 @@ jobs:
name: Build PDF (fast)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ComPWA/actions/pip-install@v1
with:
additional-packages: tox
Expand All @@ -55,7 +55,7 @@ jobs:
name: Check external links
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ComPWA/actions/pip-install@v1
with:
additional-packages: tox
Expand All @@ -68,7 +68,7 @@ jobs:
if: github.event_name != 'pull_request'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ComPWA/actions/pip-install@v1
with:
additional-packages: tox
Expand All @@ -82,7 +82,7 @@ jobs:
uses: actions/cache@v3
with:
key: |
julia-${{hashFiles('julia/Manifest.toml')}}-${{hashFiles('**.jl')}}
julia-${{hashFiles('julia/Manifest.toml')}}-${{hashFiles('**/*.jl')}}
restore-keys: |
julia-${{hashFiles('julia/Manifest.toml')}}
julia
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/julia.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Julia

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
JULIA_CI: "true"
JULIA_COLOR: "yes"

on:
push:
branches:
- main
- epic/*
- "[0-9]+.[0-9]+.x"
paths:
- "**.jl"
- "**/Manifest.toml"
- "**/Project.toml"
- "!**/exportnotebooks.jl"
pull_request:
branches:
- main
- epic/*
- "[0-9]+.[0-9]+.x"
paths:
- "**.jl"
- "**/Manifest.toml"
- "**/Project.toml"
- "!**/exportnotebooks.jl"

jobs:
build:
name: Run scripts
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Extract locked Julia version
id: extract-version
run: |
VERSION=$(grep 'julia_version = ' julia/Manifest.toml | head -n 1 | cut -d '"' -f 2)
echo "version=$VERSION" | tee -a $GITHUB_OUTPUT
- uses: julia-actions/setup-julia@v1
with:
version: ${{ steps.extract-version.outputs.version }}
- name: Fetch Julia cache
uses: actions/cache@v3
with:
key: |
julia-${{hashFiles('julia/Manifest.toml')}}-${{hashFiles('**/*.jl')}}
restore-keys: |
julia-${{hashFiles('julia/Manifest.toml')}}
julia
path: |
./julia-*/
~/.julia/
- run: julia --project=. -e 'using Pkg; Pkg.instantiate()'
working-directory: julia/
- name: Run scripts in julia directory
run: |
for script in notebooks/*.jl scripts/*.jl; do
echo -e "\n\n\033[34m--== Running $script ==--\033[0m\n"
julia --color=yes --project=. "$script" && echo -e "\033[32m SUCCESS\033[0m"
done
working-directory: julia/
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
"source.organizeImports": "explicit"
},
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.rulers": [88]
Expand Down
2 changes: 2 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: polarimetry
channels:
- defaults
- conda-forge
dependencies:
- juliaup
- python==3.8.*
- pip>=21.3 # pyproject.toml
- pip:
Expand Down
Loading

0 comments on commit 274de39

Please sign in to comment.