From b4abe63415013b096f016bee3f3dfb89b61b19cc Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Fri, 15 Dec 2023 14:57:43 +0100 Subject: [PATCH] DX: run all julia scripts in GitHub Actions --- .cspell.json | 1 + .github/workflows/julia.yml | 48 +++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 .github/workflows/julia.yml diff --git a/.cspell.json b/.cspell.json index df77192e..a32cc5ec 100644 --- a/.cspell.json +++ b/.cspell.json @@ -100,6 +100,7 @@ "cmin", "commitlint", "einsum", + "exportnotebooks", "hangle", "iminuit", "ipynb", diff --git a/.github/workflows/julia.yml b/.github/workflows/julia.yml new file mode 100644 index 00000000..f8eb4c96 --- /dev/null +++ b/.github/workflows/julia.yml @@ -0,0 +1,48 @@ +env: + JULIA_CI: "true" + +on: + push: + branches: + - main + - epic/* + - "[0-9]+.[0-9]+.x" + paths: + - "**/*.jl" + - "**/Manifest.toml" + - "**/Project.toml" + paths-ignore: + - "**/exportnotebooks.jl" + pull_request: + branches: + - main + - epic/* + - "[0-9]+.[0-9]+.x" + paths: + - "**/*.jl" + - "**/Manifest.toml" + - "**/Project.toml" + paths-ignore: + - "**/exportnotebooks.jl" + +jobs: + build: + name: Run Julia scripts + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: Extract locked Julia version + id: extract-version + run: | + VERSION=$(grep 'julia_version = ' Manifest.toml | head -n 1 | cut -d '"' -f 2) + echo "::set-output name=version::$VERSION" + - uses: julia-actions/setup-julia@v1 + with: + version: ${{ steps.extract-version.outputs.version }} + - name: Run scripts in julia directory + run: | + for script in notebooks/*.jl scripts/*.jl; do + echo -e "\n\n--== Running $script ==--\n" + julia --project=. "$script" + done + working-directory: julia/