Skip to content

Commit 9ea8316

Browse files
committed
update CI workflows
based on templates from PkgTemplates.jl
1 parent ed74089 commit 9ea8316

File tree

3 files changed

+58
-42
lines changed

3 files changed

+58
-42
lines changed

.github/workflows/CompatHelper.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: CompatHelper
2+
on:
3+
schedule:
4+
- cron: '0 0 * * *' # Everyday at midnight
5+
workflow_dispatch:
6+
jobs:
7+
CompatHelper:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
steps:
12+
- name: Install CompatHelper
13+
run: using Pkg; Pkg.add("CompatHelper")
14+
shell: julia --color=yes {0}
15+
- name: Run CompatHelper
16+
run: using CompatHelper; CompatHelper.main()
17+
shell: julia --color=yes {0}
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}

.github/workflows/documentation.yml

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,39 @@ name: Documentation
22

33
on:
44
push:
5-
branches:
6-
- main
7-
tags: '*'
5+
branches: [ main ]
6+
tags: "v?[0-9]+.[0-9]+.[0-9]+**"
87
pull_request:
8+
branches: [ main ]
9+
workflow_dispatch:
10+
11+
permissions:
12+
actions: write # needed to allow julia-actions/cache to proactively delete old caches that it has created
13+
contents: write
14+
statuses: write
915

1016
jobs:
1117
build:
1218
runs-on: ubuntu-latest
1319
steps:
14-
- uses: actions/checkout@v2
15-
- uses: julia-actions/setup-julia@latest
20+
- uses: actions/checkout@v4
21+
- uses: julia-actions/setup-julia@v2
1622
with:
17-
version: '1.6'
18-
- name: Install dependencies
19-
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
20-
- name: Build and deploy
23+
version: '1'
24+
- name: Configure doc environment
25+
shell: julia --project=docs --color=yes {0}
26+
run: |
27+
using Pkg
28+
Pkg.develop(PackageSpec(path=pwd()))
29+
Pkg.instantiate()
30+
- uses: julia-actions/julia-buildpkg@v1
31+
- uses: julia-actions/julia-docdeploy@v1
2132
env:
2233
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23-
run: julia --project=docs/ docs/make.jl
34+
- name: Run doctests
35+
shell: julia --project=docs --color=yes {0}
36+
run: |
37+
using Documenter: DocMeta, doctest
38+
using Muon
39+
DocMeta.setdocmeta!(Muon, :DocTestSetup, :(using Muon); recursive=true)
40+
doctest(Muon)

.github/workflows/runtests.yml

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,36 @@
1-
# This is a basic workflow to help you get started with Actions
2-
31
name: runtests
42

5-
# Controls when the action will run.
63
on:
7-
# Triggers the workflow on push or pull request events but only for the main branch
84
push:
95
branches: [ main ]
106
pull_request:
117
branches: [ main ]
12-
13-
# Allows you to run this workflow manually from the Actions tab
148
workflow_dispatch:
159

16-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1710
jobs:
18-
# This workflow contains a single job called "build"
1911
test:
20-
# The type of runner that the job will run on
2112
runs-on: ${{ matrix.os }}
2213
strategy:
14+
fail-fast: false
2315
matrix:
24-
julia-version: ['~1.6', '~1.7']
16+
julia-version: [lts, "1", pre]
2517
os: [ubuntu-latest]
18+
timeout-minutes: 60
19+
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
20+
actions: write
21+
contents: read
2622

27-
# Steps represent a sequence of tasks that will be executed as part of the job
2823
steps:
29-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
30-
- uses: actions/checkout@v2
24+
- uses: actions/checkout@v4
3125

32-
# Setup Julia environment
3326
- name: "Setup Julia"
34-
uses: julia-actions/setup-julia@v1
27+
uses: julia-actions/setup-julia@v2
3528
with:
3629
version: ${{ matrix.julia-version }}
30+
- uses: julia-actions/cache@v2
31+
- uses: julia-actions/julia-buildpkg@v1
3732

38-
# Cache binary artifacts
39-
- uses: actions/cache@v4
40-
env:
41-
cache-name: cache-artifacts
42-
with:
43-
path: |
44-
~/.julia/artifacts
45-
~/.julia/packages
46-
~/.julia/registries
47-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
48-
restore-keys: |
49-
${{ runner.os }}-test-${{ env.cache-name }}-
50-
${{ runner.os }}-test-
51-
${{ runner.os }}-
52-
53-
# run unit tests
54-
- name: "run unit tests"
33+
- name: "run tests"
5534
uses: julia-actions/julia-runtest@v1
5635
with:
5736
coverage: false

0 commit comments

Comments
 (0)