mirror of
https://gitlab.cern.ch/wotsubo/PSBoardDataBase.git
synced 2025-06-08 05:55:42 +09:00
Merge branch 'add-ci' into 'main'
Add CI See merge request wotsubo/PSBoardDataBase!1
This commit is contained in:
commit
d7b1b08f3b
7 changed files with 108 additions and 13 deletions
43
.gitlab-ci.yml
Normal file
43
.gitlab-ci.yml
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
.script:
|
||||||
|
script:
|
||||||
|
- |
|
||||||
|
julia --project=@. -e '
|
||||||
|
using Pkg
|
||||||
|
Pkg.build()
|
||||||
|
Pkg.test(coverage=true)'
|
||||||
|
.coverage:
|
||||||
|
coverage: /Test coverage (\d+\.\d+%)/
|
||||||
|
after_script:
|
||||||
|
- |
|
||||||
|
julia -e '
|
||||||
|
using Pkg
|
||||||
|
Pkg.add("Coverage")
|
||||||
|
using Coverage
|
||||||
|
c, t = get_summary(process_folder())
|
||||||
|
using Printf
|
||||||
|
@printf "Test coverage %.2f%%\n" 100c / t'
|
||||||
|
Julia 1.10:
|
||||||
|
image: julia:1.10
|
||||||
|
extends:
|
||||||
|
- .script
|
||||||
|
- .coverage
|
||||||
|
pages:
|
||||||
|
image: julia:1.10
|
||||||
|
stage: deploy
|
||||||
|
script:
|
||||||
|
- |
|
||||||
|
julia --project=docs -e '
|
||||||
|
using Pkg
|
||||||
|
Pkg.develop(PackageSpec(path=pwd()))
|
||||||
|
Pkg.instantiate()
|
||||||
|
using Documenter: doctest
|
||||||
|
using PSBoardDataBase
|
||||||
|
doctest(PSBoardDataBase)
|
||||||
|
include("docs/make.jl")'
|
||||||
|
- mkdir -p public
|
||||||
|
- mv docs/build public/dev
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- public
|
||||||
|
only:
|
||||||
|
- main
|
|
@ -1,6 +1,6 @@
|
||||||
name = "PSBoardDataBase"
|
name = "PSBoardDataBase"
|
||||||
uuid = "779f6a9c-59fa-41f1-8ed1-e9a91eccb2f5"
|
uuid = "779f6a9c-59fa-41f1-8ed1-e9a91eccb2f5"
|
||||||
authors = ["qwjyh <urataw421@gmail.com>"]
|
authors = ["Wataru Otsubo <wotsubo@icepp.s.u-tokyo.ac.jp>"]
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
|
@ -289,10 +289,8 @@ uuid = "efcefdf7-47ab-520b-bdef-62a2eaa19f15"
|
||||||
version = "10.42.0+1"
|
version = "10.42.0+1"
|
||||||
|
|
||||||
[[deps.PSBoardDataBase]]
|
[[deps.PSBoardDataBase]]
|
||||||
deps = ["CSV", "DBInterface", "DataFrames", "Dates", "SQLite", "Tables"]
|
deps = ["CSV", "DBInterface", "DataFrames", "Dates", "Documenter", "SQLite", "Tables"]
|
||||||
git-tree-sha1 = "50d84cb861c95ea8f20db4466a4ce03b917904f6"
|
path = ".."
|
||||||
repo-rev = "main"
|
|
||||||
repo-url = ".."
|
|
||||||
uuid = "779f6a9c-59fa-41f1-8ed1-e9a91eccb2f5"
|
uuid = "779f6a9c-59fa-41f1-8ed1-e9a91eccb2f5"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
weakdeps = ["InteractiveUtils"]
|
weakdeps = ["InteractiveUtils"]
|
||||||
|
|
14
docs/make.jl
14
docs/make.jl
|
@ -1,6 +1,18 @@
|
||||||
using Documenter, PSBoardDataBase
|
using Documenter, PSBoardDataBase
|
||||||
|
|
||||||
|
DocMeta.setdocmeta!(PSBoardDataBase, :DocTestSetup, :(using PSBoardDataBase); recursive = true)
|
||||||
|
|
||||||
makedocs(
|
makedocs(
|
||||||
|
modules = [PSBoardDataBase],
|
||||||
|
authors = "Wataru Otsubo <wotsubo@icepp.s.u-tokyo.ac.jp>",
|
||||||
sitename = "PSBoard DataBase",
|
sitename = "PSBoard DataBase",
|
||||||
repo = Remotes.GitLab("https://gitlab.cern.ch/wotsubo/PSBoardDataBase")
|
format = Documenter.HTML(;
|
||||||
|
canonical = "https://wotsubo.web.cern.ch",
|
||||||
|
edit_link = "main",
|
||||||
|
assets = String[],
|
||||||
|
),
|
||||||
|
repo = Remotes.GitLab("https://gitlab.cern.ch", "wotsubo", "PSBoardDataBase"),
|
||||||
|
pages = [
|
||||||
|
"Home" => "index.md",
|
||||||
|
]
|
||||||
)
|
)
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
```@meta
|
||||||
|
CurrentModule = PSBoardDataBase
|
||||||
|
```
|
||||||
|
|
||||||
|
# About
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
```@index
|
||||||
|
```
|
||||||
|
|
||||||
|
```@autodocs
|
||||||
|
Modules = [PSBoardDataBase]
|
||||||
|
```
|
||||||
|
|
||||||
|
### `QaqcMasterLog`
|
||||||
|
|
||||||
|
```@autodocs
|
||||||
|
Modules = [QaqcMasterLog]
|
||||||
|
```
|
|
@ -13,6 +13,26 @@ include("create_table.jl")
|
||||||
|
|
||||||
include("import_data.jl")
|
include("import_data.jl")
|
||||||
|
|
||||||
|
"""
|
||||||
|
create_database_from_exported_csvs(
|
||||||
|
dbpath::AbstractString;
|
||||||
|
single_run_csv::AbstractString,
|
||||||
|
runlist_csv::AbstractString,
|
||||||
|
dispatch_csv::AbstractString,
|
||||||
|
hundred_csv::AbstractString,
|
||||||
|
masterlog_dir::AbstractString,
|
||||||
|
)
|
||||||
|
|
||||||
|
Create database at `dbpath` and import data from CSV and master log files.
|
||||||
|
|
||||||
|
# Arguments
|
||||||
|
- `dbpath`: where the database will be created
|
||||||
|
- `single_run_csv`: CSV of single run results exported from the Google sheets database
|
||||||
|
- `runlist_csv`: CSV of run lists exported from the Google sheets database
|
||||||
|
- `dispatch_csv`: CSV of dispatch lists exported from the Google sheets database
|
||||||
|
- `hundred_csv`: CSV of 100 tests results exported from the Google sheets database
|
||||||
|
- `masterlog_dir`: path to the directory (`log`) where all JATHub master log is stored
|
||||||
|
"""
|
||||||
function create_database_from_exported_csvs(
|
function create_database_from_exported_csvs(
|
||||||
dbpath::AbstractString;
|
dbpath::AbstractString;
|
||||||
single_run_csv::AbstractString,
|
single_run_csv::AbstractString,
|
||||||
|
|
|
@ -51,6 +51,7 @@ true || include("../src/PSBoardDataBase.jl")
|
||||||
|
|
||||||
@test PSBoardDataBase.add_qaqc_dispatch(db, dispatch_table) |> isnothing
|
@test PSBoardDataBase.add_qaqc_dispatch(db, dispatch_table) |> isnothing
|
||||||
|
|
||||||
|
if haskey(ENV, "LOCAL_TEST")
|
||||||
@test PSBoardDataBase.add_qaqc_runlist_from_masterlogs(db, "input/log/") |>
|
@test PSBoardDataBase.add_qaqc_runlist_from_masterlogs(db, "input/log/") |>
|
||||||
isnothing
|
isnothing
|
||||||
|
|
||||||
|
@ -63,3 +64,4 @@ true || include("../src/PSBoardDataBase.jl")
|
||||||
run(`sqlitebrowser $dbpath`)
|
run(`sqlitebrowser $dbpath`)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue