From 4979f5a7aa3254b6bef496b4e970a4c012fe6f0e Mon Sep 17 00:00:00 2001 From: Oliver Schulz Date: Fri, 3 Dec 2021 01:59:38 +0100 Subject: [PATCH] Update CI and deps, require Julia v1.6 --- .codecov.yml | 1 + .github/workflows/CompatHelper.yml | 32 +++++++++ .github/workflows/TagBot.yml | 15 +++++ .github/workflows/ci.yml | 103 +++++++++++++++++++++++++++++ .gitignore | 1 + Project.toml | 8 +-- README.md | 11 ++- docs/.gitignore | 2 + docs/Project.toml | 6 ++ docs/make.jl | 39 +++++++++++ docs/src/LICENSE.md | 6 ++ docs/src/api.md | 26 ++++++++ docs/src/index.md | 1 + test/Project.toml | 2 + 14 files changed, 246 insertions(+), 7 deletions(-) create mode 100644 .codecov.yml create mode 100644 .github/workflows/CompatHelper.yml create mode 100644 .github/workflows/TagBot.yml create mode 100644 .github/workflows/ci.yml create mode 100644 docs/.gitignore create mode 100644 docs/Project.toml create mode 100644 docs/make.jl create mode 100644 docs/src/LICENSE.md create mode 100644 docs/src/api.md create mode 100644 docs/src/index.md create mode 100644 test/Project.toml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000..ac54655 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1 @@ +# comment: false diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml new file mode 100644 index 0000000..d94b38d --- /dev/null +++ b/.github/workflows/CompatHelper.yml @@ -0,0 +1,32 @@ +name: CompatHelper +on: + schedule: + - cron: 0 0 * * * + workflow_dispatch: +jobs: + CompatHelper: + runs-on: ubuntu-latest + steps: + - 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 }} diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml new file mode 100644 index 0000000..f49313b --- /dev/null +++ b/.github/workflows/TagBot.yml @@ -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 }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ea22dde --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,103 @@ +name: CI + +on: + push: + branches: + - master + - 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.6' + - '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@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 + env: + DATADEPS_ALWAYS_ACCEPT: 'true' + 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@v1 + 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@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' diff --git a/.gitignore b/.gitignore index 318e444..d0b53d9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ *.jl.*.cov *.jl.mem .ipynb_checkpoints +.vscode Manifest.toml diff --git a/Project.toml b/Project.toml index 75ee634..e724071 100644 --- a/Project.toml +++ b/Project.toml @@ -1,11 +1,9 @@ name = "LegendTestData" uuid = "33d6da08-6349-5f7c-b5a4-6ff4d8795aaf" +version = "0.1" [deps] DataDeps = "124859b0-ceae-595e-8997-d05f6a7a8dfe" -[extras] -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[targets] -test = ["Test"] +[compat] +DataDeps = "0.7" diff --git a/README.md b/README.md index e8f2e2a..b38e4a0 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,18 @@ # LegendTestData.jl +[![Documentation for stable version](https://img.shields.io/badge/docs-stable-blue.svg)](https://legend-exp.github.io/LegendTestData.jl/stable) +[![Documentation for development version](https://img.shields.io/badge/docs-dev-blue.svg)](https://legend-exp.github.io/LegendTestData.jl/dev) [![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](LICENSE.md) -[![Travis Build Status](https://travis-ci.com/legend-exp/LegendTestData.jl.svg?branch=master)](https://travis-ci.com/legend-exp/LegendTestData.jl) -[![Appveyor Build Status](https://ci.appveyor.com/api/projects/status/github/legend-exp/LegendTestData.jl?branch=master&svg=true)](https://ci.appveyor.com/project/legend-exp/LegendTestData-jl) +[![Build Status](https://github.com/legend-exp/LegendTestData.jl/workflows/CI/badge.svg?branch=master)](https://github.com/legend-exp/LegendTestData.jl/actions?query=workflow%3ACI) [![Codecov](https://codecov.io/gh/legend-exp/LegendTestData.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/legend-exp/LegendTestData.jl) +## Documentation + +* [Documentation for stable version](https://legend-exp.github.io/LegendTestData.jl/stable) +* [Documentation for development version](https://legend-exp.github.io/LegendTestData.jl/dev) + + Julia package to provide access to the [LEGEND Test Data](https://github.com/legend-exp/legend-testdata). Test data is downloaded and installed on package build: diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..a303fff --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,2 @@ +build/ +site/ diff --git a/docs/Project.toml b/docs/Project.toml new file mode 100644 index 0000000..f471c80 --- /dev/null +++ b/docs/Project.toml @@ -0,0 +1,6 @@ +[deps] +Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a" + +[compat] +Documenter = "~0.27" diff --git a/docs/make.jl b/docs/make.jl new file mode 100644 index 0000000..640c0d5 --- /dev/null +++ b/docs/make.jl @@ -0,0 +1,39 @@ +# Use +# +# DOCUMENTER_DEBUG=true julia --color=yes make.jl local [nonstrict] [fixdoctests] +# +# for local builds. + +using Documenter +using LegendTestData + +# Doctest setup +DocMeta.setdocmeta!( + LegendTestData, + :DocTestSetup, + :(using LegendTestData); + recursive=true, +) + +makedocs( + sitename = "LegendTestData", + modules = [LegendTestData], + format = Documenter.HTML( + prettyurls = !("local" in ARGS), + canonical = "https://legend-exp.github.io/LegendTestData.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/legend-exp/LegendTestData.jl.git", + forcepush = true, + push_preview = true, +) diff --git a/docs/src/LICENSE.md b/docs/src/LICENSE.md new file mode 100644 index 0000000..b1bd836 --- /dev/null +++ b/docs/src/LICENSE.md @@ -0,0 +1,6 @@ +# LICENSE + +```@eval +using Markdown +Markdown.parse_file(joinpath(@__DIR__, "..", "..", "LICENSE.md")) +``` diff --git a/docs/src/api.md b/docs/src/api.md new file mode 100644 index 0000000..31f0029 --- /dev/null +++ b/docs/src/api.md @@ -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 = [LegendTestData] +Order = [:module, :type, :constant, :macro, :function] +``` diff --git a/docs/src/index.md b/docs/src/index.md new file mode 100644 index 0000000..52c9ed5 --- /dev/null +++ b/docs/src/index.md @@ -0,0 +1 @@ +# LegendTestData.jl diff --git a/test/Project.toml b/test/Project.toml new file mode 100644 index 0000000..0c36332 --- /dev/null +++ b/test/Project.toml @@ -0,0 +1,2 @@ +[deps] +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"