Julia Devcontainer Sample
$ git config --global user.name "yourusername"
$ git config --global user.email "your.user@domain.com"
$ git config --global github.user "your-gh-user"julia
julia> using PkgTemplates
julia> tpl = Template(;
dir="/workspaces/sample-julia",
plugins=[
# Git(; manifest=true, ssh=true),
# GitHubActions(; x86=true),
# Codecov(),
# Documenter{GitHubActions}(),
],
)
julia> tpl("SampleJulia")
SampleJulia directory like the following should be displayed in your favorite IDE:
SampleJulia/
├── .github
│ ├── dependabot.yml
│ └── workflows
│ ├── CI.yml
│ ├── CompatHelper.yml
│ └── TagBot.yml
├── .gitignore
├── LICENSE
├── Manifest.toml
├── Project.toml
├── README.md
├── src
│ └── SampleJulia.jl
└── test
└── runtests.jl
Edit src/SampleJulia with
module SampleJulia
function greet()
println("Hello Julia!")
end
function add(x, y)
x + y
end
greet()
end$ cd SampleJulia
$ julia --project=. src/SampleJulia.jl- Edit
test/runtests.jl
using SampleJulia: add
using Test
@testset "SampleJulia.jl" begin
@test add(1, 2) == 3
end- Run unit tests
julia> ]
pkg> activate .
pkg> test
...
Testing Running tests...
Test Summary: | Pass Total Time
SampleJulia.jl | 1 1 0.0s
Testing SampleJulia tests passed
Currently package is available at /workspaces/sample-julia/SampleJulia.
Move it to have it available at /workspaces/sample-julia/
Be aware that README.md (ie this file) will be overwritten by those from SampleJulia directory!
$ shopt -s dotglob
$ mv -f SampleJulia/* .Remove SampleJulia if nothing important for you is still there.