Skip to content

Commit b89b083

Browse files
add workflows
1 parent 613c6c2 commit b89b083

File tree

6 files changed

+157
-4
lines changed

6 files changed

+157
-4
lines changed

.github/workflows/CompatHelper.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CompatHelper
2+
on:
3+
schedule:
4+
- cron: 0 0 * * *
5+
workflow_dispatch:
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
jobs:
10+
CompatHelper:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check if Julia is already available in the PATH
14+
id: julia_in_path
15+
run: which julia
16+
continue-on-error: true
17+
- name: Install Julia, but only if it is not already available in the PATH
18+
uses: julia-actions/setup-julia@v1
19+
with:
20+
version: '1.8'
21+
arch: ${{ runner.arch }}
22+
if: steps.julia_in_path.outcome != 'success'
23+
- name: "Add the General registry via Git"
24+
run: |
25+
import Pkg
26+
ENV["JULIA_PKG_SERVER"] = ""
27+
Pkg.Registry.add("General")
28+
shell: julia --color=yes {0}
29+
- name: "Install CompatHelper"
30+
run: |
31+
import Pkg
32+
name = "CompatHelper"
33+
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
34+
version = "3"
35+
Pkg.add(; name, uuid, version)
36+
shell: julia --color=yes {0}
37+
- name: "Run CompatHelper"
38+
run: |
39+
import CompatHelper
40+
CompatHelper.main()
41+
shell: julia --color=yes {0}
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
45+
# COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}

.github/workflows/Documenter.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main # update to match your development branch (master, main, dev, trunk, ...)
7+
tags: '*'
8+
pull_request:
9+
10+
jobs:
11+
build:
12+
permissions:
13+
contents: write
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: julia-actions/setup-julia@v1
18+
with:
19+
version: '1.8'
20+
- name: Install dependencies
21+
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
22+
- name: Build and deploy
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
25+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key
26+
run: julia --project=docs/ docs/make.jl
27+

.github/workflows/Formatter.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: format-check
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
tags: '*'
8+
pull_request:
9+
10+
jobs:
11+
build:
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
julia-version: [1]
16+
julia-arch: [x86]
17+
os: [ubuntu-latest]
18+
steps:
19+
- uses: julia-actions/setup-julia@latest
20+
with:
21+
version: ${{ matrix.julia-version }}
22+
23+
- uses: actions/checkout@v1
24+
- name: Install JuliaFormatter and format
25+
# This will use the latest version by default but you can set the version like so:
26+
#
27+
# julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))'
28+
run: |
29+
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
30+
julia -e 'using JuliaFormatter; format(".", verbose=true)'
31+
- name: Format check
32+
run: |
33+
julia -e '
34+
out = Cmd(`git diff --name-only`) |> read |> String
35+
if out == ""
36+
exit(0)
37+
else
38+
@error "Some files have not been formatted !!!"
39+
write(stdout, out)
40+
exit(1)
41+
end'

.github/workflows/TagBot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: TagBot
2+
on:
3+
issue_comment:
4+
types:
5+
- created
6+
workflow_dispatch:
7+
jobs:
8+
TagBot:
9+
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: JuliaRegistries/TagBot@v1
13+
with:
14+
token: ${{ secrets.GITHUB_TOKEN }}
15+
ssh: ${{ secrets.DOCUMENTER_KEY }}

.github/workflows/Tests.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main # update to match your development branch (master, main, dev, trunk, ...)
7+
tags: '*'
8+
pull_request:
9+
10+
jobs:
11+
test:
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
julia_version: ['1.8']
17+
os: [ubuntu-latest]
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: "Set up Julia"
21+
uses: julia-actions/setup-julia@latest
22+
with:
23+
version: ${{ matrix.julia_version }}
24+
- name: "Build package"
25+
uses: julia-actions/julia-buildpkg@v1
26+
- name: "Run tests"
27+
uses: julia-actions/julia-runtest@v1

docs/make.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ using Documenter, DocumenterMarkdown
22
using ReactiveDynamics
33

44
makedocs(format = Documenter.HTML(prettyurls = false, edit_link = nothing),
5-
sitename = "ReactiveDynamics.jl API Documentation",
6-
build = "build_html", pages = ["index.md"])
5+
sitename = "ReactiveDynamics.jl API Documentation", pages = ["index.md"])
76

8-
makedocs(format = Markdown(), sitename = "ReactiveDynamics.jl API Documentation",
9-
build = "build_md", pages = ["index.md"])
7+
deploydocs(repo = "github.com/Merck/ReactiveDynamics.jl.git")

0 commit comments

Comments
 (0)