Skip to content

Commit

Permalink
Initial package layout
Browse files Browse the repository at this point in the history
  • Loading branch information
oschulz committed Apr 22, 2021
1 parent 2e5b202 commit 19da248
Show file tree
Hide file tree
Showing 18 changed files with 325 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
20 changes: 20 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: CompatHelper

on:
schedule:
- cron: '00 00 * * *'
push:
branches:
- actions/trigger/CompatHelper
workflow_dispatch:
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
15 changes: 15 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: TagBot
on:
issue_comment:
types:
- created
workflow_dispatch:
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 }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
100 changes: 100 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: CI

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

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.3'
- '1'
# - 'nightly'
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
- x86
exclude:
# 32-bit Julia binaries are not available on macOS
- os: macOS-latest
arch: x86
- os: windows-latest
arch: x86
- version: nightly
arch: x86
- version: nightly
os: macOS-latest
- version: nightly
os: windows-latest
- version: 1.3
os: macOS-latest
- version: 1.3
os: windows-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- name: Cache artifacts
uses: actions/cache@v2
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@latest
env:
PYTHON: 'Conda'
- uses: julia-actions/julia-runtest@latest
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
with:
version: '1'
- name: Cache artifacts
uses: actions/cache@v2
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/docs/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@latest
env:
PYTHON: 'Conda'
- uses: julia-actions/julia-docdeploy@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Needed due to https://github.com/JuliaDocs/Documenter.jl/issues/1177
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
GKSwstype: 'nul'
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.DS_Store
*.jl.cov
*.jl.*.cov
*.jl.mem
.ipynb_checkpoints
.vscode
Manifest.toml
24 changes: 24 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
The BATBase.jl package is licensed under the MIT "Expat" License:

> Copyright (c) 2017-2021:
>
> 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.
>
14 changes: 14 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name = "BATBase"
uuid = "b4d2a721-a957-46f4-b6b6-f139c9e7db21"
version = "0.1.0"

[deps]

[compat]
julia = "1"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# BATBase.jl

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


## Documentation

* [Documentation for stable version](https://bat.github.io/BATBase.jl/stable)
* [Documentation for development version](https://bat.github.io/BATBase.jl/dev)
2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/
site/
6 changes: 6 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"

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

using Documenter
using BATBase

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

deploydocs(
repo = "github.com/bat/BATBase.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"))
```
32 changes: 32 additions & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# API

```@meta
DocTestSetup = quote
using BATBase
end
```

## Modules

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

## Types and constants

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

## Functions and macros

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

# Documentation

```@autodocs
Modules = [BATBase]
Order = [:module, :type, :constant, :macro, :function]
```
1 change: 1 addition & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# BATBase.jl
14 changes: 14 additions & 0 deletions src/BATBase.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file is a part of BATBase.jl, licensed under the MIT License (MIT).

__precompile__(true)

"""
BATBase
Template for Julia packages.
"""
module BATBase

include("hello_world.jl")

end # module
23 changes: 23 additions & 0 deletions src/hello_world.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This file is a part of BATBase.jl, licensed under the MIT License (MIT).


"""
BATBase.hello_world()
Prints "Hello, World!" and returns 42.
```jldoctest
using BATBase
BATBase.hello_world()
# output
Hello, World!
42
```
"""
function hello_world()
println("Hello, World!")
return 42
end
7 changes: 7 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file is a part of BATBase.jl, licensed under the MIT License (MIT).

import Test

Test.@testset "Package BATBase" begin
include("test_hello_world.jl")
end # testset
9 changes: 9 additions & 0 deletions test/test_hello_world.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file is a part of BATBase.jl, licensed under the MIT License (MIT).

using BATBase
using Test


@testset "hello_world" begin
@test BATBase.hello_world() == 42
end

0 comments on commit 19da248

Please sign in to comment.