Julia Packages and GitHub actions

(I basically followed this advice to prepare these slides)

Julia basics


export ω_c # Exports “myfun” when “using MyModule”; yes, you can use unicode

function ω_c(m,q,B) # A simple function declaration q*B/m # The last computation is the return value of the function end

end

- In the REPL:
```julia
include("file_containing_the_code_above.jl") # Inputs its contents in the REPL
using .MyModule # The dot is because MyModule is defined in Main
 
ω_c(1.2,3.5,4.6) # --> 13.416666666666666



[deps] Unitful = “1986cc42-f94f-5a68-af5c-568840ba703d”

[compat] julia = “1.3.0”

- The compat block is added manually; needed if we ever want to register the package in the julia servers for others to use

---

- Adding tests: Create a subdirectory named "test" and `cd` there. `activate` the test directory and do `] add Test`. This is a separate (sub)environment 
- Create the file `runtests.jl` in the test directory:
```julia
using Test, MyModule 
 
@test ω_c(1,1,1) == 1   


export ω_c # Exports “myfun” when “using MyModule”; yes, you can use unicode

””” ω_c(m,q,B)

Compute the gyrofrequency of a charged species “”” function ω_c(m,q,B) # A simple function declaration q*B/m # The last computation is the return value of the function end

end

- They are used in the help mode: `?ω_c`
- Docstrings are also used by the Documenter package

---

- Create a subdirectory named "docs"
- Generate the skeleton of the documentation (the "docs" folder is itself another Julia (sub)package):
```julia
]  activate # Without arguments, this makes the "base" environment active
]  add Documenter, DocumenterTools
 
using DocumenterTools
cd("~/.julia/dev/MyModule")
DocumenterTools.generate()

Final notes:

GitHub Actions

Some quick tricks:



```