Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI for Documentation and tests #10

Merged
merged 6 commits into from
May 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: CI
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.5'
- '1'
- 'nightly'
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
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
- uses: julia-actions/julia-runtest@latest
# No Codecov yet
#- 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@v1
with:
version: '1'
- run: |
julia --project=docs -e '
import Pkg; Pkg.add("Documenter")
using Pkg
Pkg.develop(Pkg.PackageSpec(path=pwd()))
Pkg.instantiate()'
- run: |
julia --project=docs -e '
import Pkg; Pkg.add("Documenter")
using Documenter: doctest
using LatSpec
doctest(LatSpec)'
- run: julia --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
**Manifest.toml
docs/build
docs/site
**.DS_Store
3 changes: 1 addition & 2 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
LatSpec = "5648dd92-b909-466b-b6bb-bca0d81a8536"

[compat]
Documenter = "0.26"
DocumenterCitations = "0.2"
Documenter = "0.26"
30 changes: 21 additions & 9 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,25 @@ using Documenter
using DocumenterCitations
using LatSpec

bib = CitationBibliography("LatSpec.bib")
makedocs(
bib,
sitename="LatSpec.jl",
pages = [
"Home" => "index.md",
"References" => "references.md"
],
format = Documenter.HTML(prettyurls = get(ENV, "CI", nothing) == "true")
bib = CitationBibliography(joinpath(@__DIR__,"LatSpec.bib"))
const PAGES = [
"Home" => "index.md",
"References" => "references.md"
]

makedocs(bib;
authors = "Bernd Riederer and Fabian Zierler",
format = Documenter.HTML(;
prettyurls = get(ENV, "CI", nothing) == "true",
assets=String[],
),
pages = PAGES,
repo="https://github.com/bernd1995/LatSpec.jl/blob/{commit}{path}#{line}",
sitename="LatSpec.jl"
)

deploydocs(;
repo = "github.com/bernd1995/LatSpec.jl",
target = "build",
push_preview = true
)
2 changes: 1 addition & 1 deletion src/statistics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Returns autocorrelation function for a distance of lag, i.e. between values of
```x[t]``` and ```x[t+lag]```. The autocorrelation function is normalized such
that ```autocor(x,0) = 1```. This is equvivalent to the quantity
``\\Gamma_X(t)`` of equation (4.61) in [GattringerLang](@cite).
``\\Gamma_X(t)`` of equation (4.61) in [Gattringer/Lang](@cite).
"""
function autocor(x, lag)
# (wasteful in terms of allocations but clear)
Expand Down