From 50052444c12cd9ffcc2d7a19f5f57442828c2cd4 Mon Sep 17 00:00:00 2001 From: Valeria Barra Date: Wed, 24 Jun 2026 13:09:37 -0700 Subject: [PATCH 1/4] Initial commit for MOLE.jl GHA yml files --- .github/workflows/julia-docs.yml | 46 +++++++++++++++ .github/workflows/julia-formatter.yml | 0 .github/workflows/julia-tests.yml | 83 +++++++++++++++++++++++++++ julia/MOLE.jl/docs/make.jl | 6 ++ 4 files changed, 135 insertions(+) create mode 100644 .github/workflows/julia-docs.yml create mode 100644 .github/workflows/julia-formatter.yml create mode 100644 .github/workflows/julia-tests.yml diff --git a/.github/workflows/julia-docs.yml b/.github/workflows/julia-docs.yml new file mode 100644 index 000000000..cd190512a --- /dev/null +++ b/.github/workflows/julia-docs.yml @@ -0,0 +1,46 @@ +name: Julia Documentation + +on: + pull_request: + push: + branches: + - main + tags: '*' + +permissions: + contents: write + pull-requests: read + statuses: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + docbuild: + runs-on: ubuntu-24.04 + + steps: + - uses: actions/checkout@v7 + + - uses: julia-actions/setup-julia@v3 + with: + version: '1.10' + + - uses: julia-actions/cache@v3 + + - name: Install dependencies + run: > + cd julia/MOLE.jl && + julia --project=docs -e 'using Pkg; + Pkg.develop(path="."); + Pkg.instantiate(; verbose=true); + Pkg.build()' + + - name: Build and deploy + env: + GKSwstype: "100" # headless GR: https://discourse.julialang.org/t/generation-of-documentation-fails-qt-qpa-xcb-could-not-connect-to-display/60988/2 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token + run: > + cd julia/MOLE.jl && + julia --project=docs docs/make.jl \ No newline at end of file diff --git a/.github/workflows/julia-formatter.yml b/.github/workflows/julia-formatter.yml new file mode 100644 index 000000000..e69de29bb diff --git a/.github/workflows/julia-tests.yml b/.github/workflows/julia-tests.yml new file mode 100644 index 000000000..0799607fc --- /dev/null +++ b/.github/workflows/julia-tests.yml @@ -0,0 +1,83 @@ +name: Julia Unit Tests + +on: + pull_request: + branches: + - main + push: + branches: + - main + tags: '*' + +# Needed to allow julia-actions/cache to delete old caches that it has created +permissions: + actions: write + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + name: Julia ${{ matrix.version }} - ${{ matrix.os }} + runs-on: ${{ matrix.os }} + timeout-minutes: ${{ matrix.os == 'macos-latest' && 120 || 80 }} + + strategy: + fail-fast: false + matrix: + version: + - '1.10' + - '1.11' + os: + - ubuntu-latest + - windows-latest + # There is a concurrency limit for MacOS runners across the + # entire organization. + # (see https://docs.github.com/en/actions/reference/limits#job-concurrency-limits-for-github-hosted-runners) + # To help with this, MacOS runners are only run when PRs are merged + # into the main branch. + - ${{ github.event_name == 'push' && 'macos-latest' || '' }} + exclude: + - os: '' + + defaults: + run: + working-directory: julia/MOLE.jl + + steps: + - name: Checkout + uses: actions/checkout@v7 + + - name: Set up Julia + uses: julia-actions/setup-julia@v3 + with: + version: ${{ matrix.version }} + + - name: Cache Julia artifacts + uses: julia-actions/cache@v3 + + - name: Build package + uses: julia-actions/julia-buildpkg@latest + with: + project: julia/MOLE.jl + + - name: Run tests + uses: julia-actions/julia-runtest@latest + with: + project: julia/MOLE.jl + + - name: Process coverage + uses: julia-actions/julia-processcoverage@v1 + if: ${{ matrix.version == '1.10' && matrix.os == 'ubuntu-latest' }} + with: + directories: julia/MOLE.jl/src + + - name: Code Coverage + uses: codecov/codecov-action@v7 + if: ${{ matrix.version == '1.10' && matrix.os == 'ubuntu-latest' }} + with: + files: lcov.info + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/julia/MOLE.jl/docs/make.jl b/julia/MOLE.jl/docs/make.jl index 4e3d6a21c..b26d21089 100644 --- a/julia/MOLE.jl/docs/make.jl +++ b/julia/MOLE.jl/docs/make.jl @@ -40,4 +40,10 @@ makedocs( ], ], ], +) + +deploydocs( + repo = "github.com/csrc-sdsu/mole.git", + devbranch = "main", + push_preview = true, ) \ No newline at end of file From d093115bf89173e5610e8c3628e7ff5261cfe05f Mon Sep 17 00:00:00 2001 From: Valeria Barra Date: Wed, 24 Jun 2026 14:04:31 -0700 Subject: [PATCH 2/4] Add Julia Formatter workflow --- .github/workflows/julia-formatter.yml | 45 +++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/.github/workflows/julia-formatter.yml b/.github/workflows/julia-formatter.yml index e69de29bb..b78263b0f 100644 --- a/.github/workflows/julia-formatter.yml +++ b/.github/workflows/julia-formatter.yml @@ -0,0 +1,45 @@ +name: Julia Formatter + +on: + pull_request: + branches: + - main + push: + branches: + - main + tags: '*' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + format: + name: Check Julia formatting + runs-on: ubuntu-latest + + defaults: + run: + working-directory: julia/MOLE.jl + + steps: + - name: Checkout + uses: actions/checkout@v7 + + - name: Set up Julia + uses: julia-actions/setup-julia@v3 + with: + version: '1.10' + + - name: Cache Julia artifacts + uses: julia-actions/cache@v3 + + - name: Install JuliaFormatter + run: julia -e 'using Pkg; Pkg.add("JuliaFormatter")' + + - name: Check formatting + run: | + julia -e ' + using JuliaFormatter + format(".", overwrite=false, verbose=true) || error("Formatting issues detected") + ' \ No newline at end of file From 41421aafb3cffb34aceb558c98f7ca5db6c4f810 Mon Sep 17 00:00:00 2001 From: Valeria Barra Date: Wed, 24 Jun 2026 14:21:24 -0700 Subject: [PATCH 3/4] Add separate readthedocs-julia.yml file --- .readthedocs-julia.yaml | 12 ++++++++++++ julia/MOLE.jl/docs/make.jl | 6 ------ 2 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 .readthedocs-julia.yaml diff --git a/.readthedocs-julia.yaml b/.readthedocs-julia.yaml new file mode 100644 index 000000000..ef7b79267 --- /dev/null +++ b/.readthedocs-julia.yaml @@ -0,0 +1,12 @@ +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.11" + julia: "1.10" + commands: + - cd julia/MOLE.jl && julia --project=docs -e 'using Pkg; Pkg.develop(path="."); Pkg.instantiate()' + - cd julia/MOLE.jl && julia --project=docs docs/make.jl + - mkdir -p _readthedocs/html + - cp -r julia/MOLE.jl/docs/build/* _readthedocs/html/ \ No newline at end of file diff --git a/julia/MOLE.jl/docs/make.jl b/julia/MOLE.jl/docs/make.jl index b26d21089..4e3d6a21c 100644 --- a/julia/MOLE.jl/docs/make.jl +++ b/julia/MOLE.jl/docs/make.jl @@ -40,10 +40,4 @@ makedocs( ], ], ], -) - -deploydocs( - repo = "github.com/csrc-sdsu/mole.git", - devbranch = "main", - push_preview = true, ) \ No newline at end of file From d8df1ccb660f8773cdec025516cd9c53559fbeae Mon Sep 17 00:00:00 2001 From: Valeria Barra Date: Wed, 24 Jun 2026 14:33:33 -0700 Subject: [PATCH 4/4] Add .JuliaFormatter.toml --- julia/MOLE.jl/.JuliaFormatter.toml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 julia/MOLE.jl/.JuliaFormatter.toml diff --git a/julia/MOLE.jl/.JuliaFormatter.toml b/julia/MOLE.jl/.JuliaFormatter.toml new file mode 100644 index 000000000..e16d1f05b --- /dev/null +++ b/julia/MOLE.jl/.JuliaFormatter.toml @@ -0,0 +1,7 @@ +indent = 4 +margin = 92 +always_for_in = true +whitespace_typedefs = true +whitespace_ops_in_indices = true +remove_extra_newlines = false +join_lines_based_on_source = true \ No newline at end of file