Skip to content

Commit

Permalink
Initial package implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
oschulz committed Dec 5, 2023
1 parent 1daab25 commit 236ad61
Show file tree
Hide file tree
Showing 27 changed files with 671 additions and 0 deletions.
1 change: 1 addition & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# comment: false
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
45 changes: 45 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CompatHelper
on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Check if Julia is already available in the PATH
id: julia_in_path
run: which julia
continue-on-error: true
- name: Install Julia, but only if it is not already available in the PATH
uses: julia-actions/setup-julia@v1
with:
version: '1'
arch: ${{ runner.arch }}
if: steps.julia_in_path.outcome != 'success'
- name: "Add the General registry via Git"
run: |
import Pkg
ENV["JULIA_PKG_SERVER"] = ""
Pkg.Registry.add("General")
shell: julia --color=yes {0}
- name: "Install CompatHelper"
run: |
import Pkg
name = "CompatHelper"
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
version = "3"
Pkg.add(; name, uuid, version)
shell: julia --color=yes {0}
- name: "Run CompatHelper"
run: |
import CompatHelper
CompatHelper.main()
shell: julia --color=yes {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
# COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}
33 changes: 33 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: TagBot
on:
issue_comment:
types:
- created
workflow_dispatch:
inputs:
lookback:
default: 3
permissions:
actions: read
checks: read
contents: write
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Edit the following line to reflect the actual name of the GitHub Secret containing your private key
ssh: ${{ secrets.DOCUMENTER_KEY }}
# ssh: ${{ secrets.NAME_OF_MY_SSH_PRIVATE_KEY_SECRET }}
81 changes: 81 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: CI

on:
push:
branches:
- main
- dev
- 'releases/**'
tags: '*'
pull_request:
release:

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.version == 'nightly' }}
strategy:
fail-fast: false
matrix:
version:
- '1.9'
- '1'
- 'nightly'
os:
- ubuntu-latest
arch:
- x64
include:
- version: 1
os: ubuntu-latest
arch: x86
- version: 1
os: macOS-latest
arch: x64
- version: 1
os: windows-latest
arch: x64
steps:
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v1
- name: registry_add
run: julia add_registries.jl
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
with:
coverage: ${{ matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.arch == 'x64' }}
- uses: julia-actions/julia-processcoverage@v1
if: matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.arch == 'x64'
- uses: codecov/codecov-action@v3
if: matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.arch == 'x64'
with:
file: lcov.info
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- uses: julia-actions/cache@v1
- name: registry_add
run: julia add_registries.jl
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-docdeploy@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Needed due to https://github.com/JuliaDocs/Documenter.jl/issues/1177
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
GKSwstype: 'nul'
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.DS_Store
*.jl.cov
*.jl.*.cov
*.jl.mem
.ipynb_checkpoints
Manifest.toml
52 changes: 52 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
## Documentation: http://docs.travis-ci.com/user/languages/julia/

language: julia

os:
- linux
- osx
- windows

julia:
- 1.0
- 1.4
- nightly

arch:
- amd64
- x86

branches:
only:
- master
- dev
- /^release-.*$/
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/

notifications:
email: false

after_success:
# push coverage results to Codecov
- julia -e 'import Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
# push coverage results to Coveralls
- julia -e 'import Pkg; Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'

jobs:
allow_failures:
- julia: nightly
fast_finish: true
exclude:
- os: osx
arch: x86
- os: windows
arch: x86
include:
- stage: "Documentation"
julia: 1.4
os: linux
arch: amd64
script:
- julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- julia --project=docs/ docs/make.jl
after_success: skip
24 changes: 24 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
The LegendEventAnalysis.jl package is licensed under the MIT "Expat" License:

> Copyright (c) 2017:
>
> Oliver Schulz <[email protected]>
>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
> in the Software without restriction, including without limitation the rights
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom the Software is
> furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in all
> copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
> SOFTWARE.
>
24 changes: 24 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name = "LegendEventAnalysis"
uuid = "ca666546-4c2a-41e4-9648-72713d810efe"
version = "0.1.0"

[deps]
ArraysOfArrays = "65a8f2f4-9b39-5baf-92e2-a9cc46fdf018"
LegendDataManagement = "9feedd95-f0e0-423f-a8dc-de0970eae6b3"
LegendDataTypes = "99e09c13-5545-5ee2-bfa2-77f358fb75d8"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
PropertyFunctions = "09e99361-2bb8-48a2-a80f-de58f0739eb4"
StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"

[compat]
ArraysOfArrays = "0.6"
LegendDataManagement = "0.2.5"
LegendDataTypes = "0.1.4"
ProgressMeter = "1"
PropertyFunctions = "0.2"
StructArrays = "0.4, 0.5, 0.6"
Tables = "1"
Unitful = "1"
julia = "1.9"
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# LegendEventAnalysis.jl

[![Documentation for stable version](https://img.shields.io/badge/docs-stable-blue.svg)](https://legend-exp.github.io/LegendEventAnalysis.jl/stable)
[![Documentation for development version](https://img.shields.io/badge/docs-dev-blue.svg)](https://legend-exp.github.io/LegendEventAnalysis.jl/dev)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](LICENSE.md)
[![Build Status](https://github.com/legend-exp/LegendEventAnalysis.jl/workflows/CI/badge.svg?branch=main)](https://github.com/legend-exp/LegendEventAnalysis.jl/actions?query=workflow%3ACI)
[![Codecov](https://codecov.io/gh/legend-exp/LegendEventAnalysis.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/legend-exp/LegendEventAnalysis.jl)


## Documentation

* [Documentation for stable version](https://legend-exp.github.io/LegendEventAnalysis.jl/stable)
* [Documentation for development version](https://legend-exp.github.io/LegendEventAnalysis.jl/dev)

LegendDataManagement.jl provides a Julia implementation of LEGEND global
event analysis tools.
1 change: 1 addition & 0 deletions add_registries.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
using Pkg; pkg"registry add General https://github.com/legend-exp/LegendJuliaRegistry.git"
2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/
site/
8 changes: 8 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
LegendTestData = "33d6da08-6349-5f7c-b5a4-6ff4d8795aaf"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
SolidStateDetectors = "71e43887-2bd9-5f77-aebd-47f656f0a3f0"

[compat]
Documenter = "1"
43 changes: 43 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Use
#
# DOCUMENTER_DEBUG=true julia --color=yes make.jl local [nonstrict] [fixdoctests]
#
# for local builds.

using Documenter
using LegendEventAnalysis

using LegendTestData
using SolidStateDetectors

# Doctest setup
DocMeta.setdocmeta!(
LegendEventAnalysis,
:DocTestSetup,
:(using LegendEventAnalysis);
recursive=true,
)

makedocs(
sitename = "LegendEventAnalysis",
modules = [LegendEventAnalysis],
format = Documenter.HTML(
prettyurls = !("local" in ARGS),
canonical = "https://legend-exp.github.io/LegendEventAnalysis.jl/stable/"
),
pages = [
"Home" => "index.md",
"API" => "api.md",
"Extensions" => "extensions.md",
"LICENSE" => "LICENSE.md",
],
doctest = ("fixdoctests" in ARGS) ? :fix : true,
linkcheck = !("nonstrict" in ARGS),
warnonly = ("nonstrict" in ARGS),
)

deploydocs(
repo = "github.com/legend-exp/LegendEventAnalysis.jl.git",
forcepush = true,
push_preview = true,
)
6 changes: 6 additions & 0 deletions docs/src/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# LICENSE

```@eval
using Markdown
Markdown.parse_file(joinpath(@__DIR__, "..", "..", "LICENSE.md"))
```
26 changes: 26 additions & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# API

## Modules

```@index
Order = [:module]
```

## Types and constants

```@index
Order = [:type, :constant]
```

## Functions and macros

```@index
Order = [:macro, :function]
```

# Documentation

```@autodocs
Modules = [LegendEventAnalysis]
Order = [:module, :type, :constant, :macro, :function]
```
Loading

0 comments on commit 236ad61

Please sign in to comment.