Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/julia-docs.yml
Original file line number Diff line number Diff line change
@@ -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
45 changes: 45 additions & 0 deletions .github/workflows/julia-formatter.yml
Original file line number Diff line number Diff line change
@@ -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")
'
83 changes: 83 additions & 0 deletions .github/workflows/julia-tests.yml
Original file line number Diff line number Diff line change
@@ -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 }}
12 changes: 12 additions & 0 deletions .readthedocs-julia.yaml
Original file line number Diff line number Diff line change
@@ -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/
7 changes: 7 additions & 0 deletions julia/MOLE.jl/.JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -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
Loading