Skip to content

Commit

Permalink
CI/CD for registering the package (#10)
Browse files Browse the repository at this point in the history
* refactor: add workflow files and bring code up-to-date

* fix: ci.myl run doctests
  • Loading branch information
ueliwechsler authored Apr 30, 2023
1 parent 6da5a86 commit 2a2dd5e
Show file tree
Hide file tree
Showing 14 changed files with 1,161 additions and 89 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CompatHelper
on:
schedule:
- cron: 0 0 * * *
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 }}
71 changes: 71 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: CI
on:
push:
paths-ignore:
- 'LICENSE.md'
- 'README.md'
branches:
- master
tags: '*'
pull_request:

jobs:
test:
name: Julia ${{ matrix.julia-version }} - ${{ matrix.os }} - ${{ matrix.julia-arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
julia-version: ['1.6', 'nightly']
os: [ubuntu-latest, macOS-latest, windows-latest]
julia-arch: [x64]
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Julia
uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}
- name: Build
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@v1
continue-on-error: ${{ matrix.julia-version == 'nightly' }}
- uses: julia-actions/julia-runtest@v1
env:
LOCAL_TEST: FALSE
continue-on-error: ${{ matrix.julia-version == 'nightly' }}
- 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.6'
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Run Doctests
run: |
julia --project=docs -e '
using Documenter: doctest
using InvariantSets
doctest(InvariantSets)'
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
run: julia --project=docs docs/make.jl
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
/docs/build/

/docs/site/
.vscode/settings.json
11 changes: 7 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@ authors = ["Ueli Wechsler"]
version = "0.1.0"

[deps]
CDDLib = "3391f64e-dcde-5f30-b752-e11513730f60"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
LazySets = "b4f0291d-fe17-52bc-9479-3d1a343d9043"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MathematicalSystems = "d14a8603-c872-5ed3-9ece-53e0e82e39da"
Polyhedra = "67491407-f73d-577b-9b50-8179a7c68029"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"

[compat]
julia = "1"
julia = "1.6"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Polyhedra = "67491407-f73d-577b-9b50-8179a7c68029"
CDDLib = "3391f64e-dcde-5f30-b752-e11513730f60"
Polyhedra = "67491407-f73d-577b-9b50-8179a7c68029"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test","Polyhedra","CDDLib"]
test = ["Test", "Polyhedra", "CDDLib"]
63 changes: 58 additions & 5 deletions examples/1_Basic_set_computation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,62 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 6,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"\u001b[32m\u001b[1m Activating\u001b[22m\u001b[39m project at `~/sw_source/InvariantSets.jl/examples`\n"
]
}
],
"source": [
"using Pkg\n",
"Pkg.activate(\".\")"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"ename": "ArgumentError",
"evalue": "ArgumentError: Package InvariantSets not found in current path:\n- Run `import Pkg; Pkg.add(\"InvariantSets\")` to install the InvariantSets package.\n",
"output_type": "error",
"traceback": [
"ArgumentError: Package InvariantSets not found in current path:\n",
"- Run `import Pkg; Pkg.add(\"InvariantSets\")` to install the InvariantSets package.\n",
"\n",
"\n",
"Stacktrace:\n",
" [1] require(into::Module, mod::Symbol)\n",
" @ Base ./loading.jl:967\n",
" [2] eval\n",
" @ ./boot.jl:373 [inlined]\n",
" [3] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)\n",
" @ Base ./loading.jl:1196\n",
" [4] #invokelatest#2\n",
" @ ./essentials.jl:716 [inlined]\n",
" [5] invokelatest\n",
" @ ./essentials.jl:714 [inlined]\n",
" [6] (::VSCodeServer.var\"#198#199\"{VSCodeServer.NotebookRunCellArguments, String})()\n",
" @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.38.2/scripts/packages/VSCodeServer/src/serve_notebook.jl:19\n",
" [7] withpath(f::VSCodeServer.var\"#198#199\"{VSCodeServer.NotebookRunCellArguments, String}, path::String)\n",
" @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.38.2/scripts/packages/VSCodeServer/src/repl.jl:249\n",
" [8] notebook_runcell_request(conn::VSCodeServer.JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, params::VSCodeServer.NotebookRunCellArguments)\n",
" @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.38.2/scripts/packages/VSCodeServer/src/serve_notebook.jl:13\n",
" [9] dispatch_msg(x::VSCodeServer.JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, dispatcher::VSCodeServer.JSONRPC.MsgDispatcher, msg::Dict{String, Any})\n",
" @ VSCodeServer.JSONRPC ~/.vscode/extensions/julialang.language-julia-1.38.2/scripts/packages/JSONRPC/src/typed.jl:67\n",
" [10] serve_notebook(pipename::String, outputchannel_logger::Base.CoreLogging.SimpleLogger; crashreporting_pipename::String)\n",
" @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.38.2/scripts/packages/VSCodeServer/src/serve_notebook.jl:139\n",
" [11] top-level scope\n",
" @ ~/.vscode/extensions/julialang.language-julia-1.38.2/scripts/notebook/notebook.jl:32"
]
}
],
"source": [
"using InvariantSets\n",
"using Plots # for Plotting 2D sets"
Expand Down Expand Up @@ -2041,15 +2094,15 @@
"lastKernelId": null
},
"kernelspec": {
"display_name": "Julia 1.4.1",
"display_name": "Julia 1.7.2",
"language": "julia",
"name": "julia-1.4"
"name": "julia-1.7"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.4.1"
"version": "1.7.2"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 2a2dd5e

Please sign in to comment.