Skip to content

Commit 0bd6e2e

Browse files
committed
ci: initial setup
1 parent 46ee01b commit 0bd6e2e

File tree

6 files changed

+155
-0
lines changed

6 files changed

+155
-0
lines changed

.github/dependabot.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ updates:
55
directory: "/" # Location of package manifests
66
schedule:
77
interval: "weekly"
8+
ignore:
9+
- dependency-name: "crate-ci/typos"
10+
update-types: ["version-update:semver-patch", "version-update:semver-minor"]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name:
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
jobs:
8+
cleanup:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout gh-pages branch
12+
uses: actions/checkout@v4
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/Downgrade.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Downgrade
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
paths-ignore:
7+
- 'docs/**'
8+
push:
9+
branches:
10+
- main
11+
paths-ignore:
12+
- 'docs/**'
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
version: ['1']
19+
group:
20+
- Core
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: julia-actions/setup-julia@v1
24+
with:
25+
version: ${{ matrix.version }}
26+
- uses: julia-actions/julia-downgrade-compat@v1
27+
# if: ${{ matrix.version == '1.6' }}
28+
with:
29+
skip: Pkg,TOML
30+
- uses: julia-actions/julia-buildpkg@v1
31+
- uses: julia-actions/julia-runtest@v1

.github/workflows/FormatCheck.yml

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

.github/workflows/Invalidations.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Invalidations
2+
3+
on:
4+
pull_request:
5+
6+
concurrency:
7+
# Skip intermediate builds: always.
8+
# Cancel intermediate builds: always.
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
evaluate:
14+
# Only run on PRs to the default branch.
15+
# In the PR trigger above branches can be specified only explicitly whereas this check should work for master, main, or any other default branch
16+
if: github.base_ref == github.event.repository.default_branch
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: julia-actions/setup-julia@v1
20+
with:
21+
version: '1'
22+
- uses: actions/checkout@v4
23+
- uses: julia-actions/julia-buildpkg@v1
24+
- uses: julia-actions/julia-invalidations@v1
25+
id: invs_pr
26+
27+
- uses: actions/checkout@v4
28+
with:
29+
ref: ${{ github.event.repository.default_branch }}
30+
- uses: julia-actions/julia-buildpkg@v1
31+
- uses: julia-actions/julia-invalidations@v1
32+
id: invs_default
33+
34+
- name: Report invalidation counts
35+
run: |
36+
echo "Invalidations on default branch: ${{ steps.invs_default.outputs.total }} (${{ steps.invs_default.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY
37+
echo "This branch: ${{ steps.invs_pr.outputs.total }} (${{ steps.invs_pr.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY
38+
- name: Check if the PR does increase number of invalidations
39+
if: steps.invs_pr.outputs.total > steps.invs_default.outputs.total
40+
run: exit 1

.github/workflows/SpellCheck.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Spell Check
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
typos-check:
7+
name: Spell Check with Typos
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout Actions Repository
11+
uses: actions/checkout@v4
12+
- name: Check spelling
13+
uses: crate-ci/[email protected]

0 commit comments

Comments
 (0)