Skip to content

Commit 2db3a81

Browse files
authored
Update GH actions and add preview for docs (#70)
* Update CompatHelper: use DOCUMENTER_KEY * Update TagBot.yml * Update CI: cancel intermediate builds + update codecov * Update docs action: cancel builds + use Julia 1 * Update downstream action: cancel builds * Preview documentation * Cleanup preview of documentation
1 parent 4317004 commit 2db3a81

File tree

7 files changed

+75
-9
lines changed

7 files changed

+75
-9
lines changed

.github/workflows/CompatHelper.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11
name: CompatHelper
22
on:
33
schedule:
4-
- cron: '00 00 * * *'
4+
- cron: 0 0 * * *
55
workflow_dispatch:
66
jobs:
77
CompatHelper:
88
runs-on: ubuntu-latest
99
steps:
10-
- name: Pkg.add("CompatHelper")
11-
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
12-
- name: CompatHelper.main()
10+
- name: "Install CompatHelper"
11+
run: |
12+
import Pkg
13+
name = "CompatHelper"
14+
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
15+
version = "3"
16+
Pkg.add(; name, uuid, version)
17+
shell: julia --color=yes {0}
18+
- name: "Run CompatHelper"
19+
run: |
20+
import CompatHelper
21+
CompatHelper.main()
22+
shell: julia --color=yes {0}
1323
env:
1424
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15-
COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }} # optional
16-
run: julia -e 'using CompatHelper; CompatHelper.main()'
25+
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Docs Preview Cleanup
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
jobs:
8+
docs-preview-cleanup:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout gh-pages branch
12+
uses: actions/checkout@v2
13+
with:
14+
ref: gh-pages
15+
- name: Delete preview and history + push changes
16+
run: |
17+
if [ -d "previews/PR$PRNUM" ]; then
18+
git config user.name "Documenter.jl"
19+
git config user.email "[email protected]"
20+
git rm -rf "previews/PR$PRNUM"
21+
git commit -m "delete preview"
22+
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
23+
git push --force origin gh-pages-new:gh-pages
24+
fi
25+
env:
26+
PRNUM: ${{ github.event.number }}

.github/workflows/TagBot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@ name: TagBot
22
on:
33
schedule:
44
- cron: 0 * * * *
5+
issue_comment:
6+
types:
7+
- created
8+
workflow_dispatch:
59
jobs:
610
TagBot:
11+
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
712
runs-on: ubuntu-latest
813
steps:
914
- uses: JuliaRegistries/TagBot@v1
1015
with:
1116
token: ${{ secrets.GITHUB_TOKEN }}
17+
ssh: ${{ secrets.DOCUMENTER_KEY }}

.github/workflows/ci.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: CI
2+
23
on:
34
pull_request:
45
branches:
@@ -7,6 +8,13 @@ on:
78
branches:
89
- master
910
tags: '*'
11+
12+
concurrency:
13+
# Skip intermediate builds: always.
14+
# Cancel intermediate builds: only if it is a pull request build.
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
17+
1018
jobs:
1119
test:
1220
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
@@ -42,6 +50,8 @@ jobs:
4250
- uses: julia-actions/julia-buildpkg@v1
4351
- uses: julia-actions/julia-runtest@v1
4452
- uses: julia-actions/julia-processcoverage@v1
45-
- uses: codecov/codecov-action@v1
53+
continue-on-error: true
54+
- uses: codecov/codecov-action@v2
55+
continue-on-error: true
4656
with:
4757
file: lcov.info

.github/workflows/docs.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
name: Documentation
2+
23
on:
34
push:
45
branches:
56
- master
67
tags: '*'
78
pull_request:
9+
10+
concurrency:
11+
# Skip intermediate builds: always.
12+
# Cancel intermediate builds: only if it is a pull request build.
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
15+
816
jobs:
917
build:
1018
runs-on: ubuntu-latest
1119
steps:
1220
- uses: actions/checkout@v2
1321
- uses: julia-actions/setup-julia@latest
1422
with:
15-
version: '1.5'
23+
version: '1'
1624
- name: Install dependencies
1725
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
1826
- name: Build and deploy

.github/workflows/downstream.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
name: IntegrationTest
2+
23
on:
34
push:
45
branches: [master]
56
tags: [v*]
67
pull_request:
78

9+
concurrency:
10+
# Skip intermediate builds: always.
11+
# Cancel intermediate builds: only if it is a pull request build.
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
14+
815
jobs:
916
test:
1017
name: ${{ matrix.package.repo }}/${{ matrix.package.group }}

docs/make.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ makedocs(modules=[DiffRules],
99
),
1010
)
1111

12-
deploydocs(repo = "github.com/JuliaDiff/DiffRules.jl")
12+
deploydocs(; repo="github.com/JuliaDiff/DiffRules.jl", push_preview=true)

0 commit comments

Comments
 (0)