Skip to content

Commit

Permalink
Standardize yml (#15)
Browse files Browse the repository at this point in the history
* Standardize yml

* Standardize make.jl

* Standardize docs

* Fix make
  • Loading branch information
JeffFessler authored Jun 1, 2024
1 parent e83e477 commit 65a928c
Show file tree
Hide file tree
Showing 12 changed files with 172 additions and 58 deletions.
5 changes: 3 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/" # Location of package manifests
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: "weekly"
41 changes: 34 additions & 7 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,47 @@ name: CompatHelper

on:
schedule:
- cron: '0 0 * * 0'
- cron: 0 0 * * 0 # weekly
workflow_dispatch:

permissions:
contents: write
pull-requests: write
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
- name: Check if Julia is already available in the PATH
id: julia_in_path
run: which julia
continue-on-error: true
- name: Install Julia, but only if it is not already available in the PATH
uses: julia-actions/setup-julia@latest
with:
version: '1'
# arch: ${{ runner.arch }}
if: steps.julia_in_path.outcome != 'success'
- name: "Add the General registry via Git"
run: |
import Pkg
ENV["JULIA_PKG_SERVER"] = ""
Pkg.Registry.add("General")
shell: julia --color=yes {0}
- name: "Install CompatHelper"
run: |
import Pkg
name = "CompatHelper"
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
version = "3"
Pkg.add(; name, uuid, version)
shell: julia --color=yes {0}
- name: "Run CompatHelper"
run: |
import CompatHelper
CompatHelper.main()
shell: julia --color=yes {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }} # optional
run: julia -e 'using CompatHelper; CompatHelper.main()'
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}

# based on:
# https://github.com/JuliaRegistries/CompatHelper.jl
30 changes: 17 additions & 13 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ name: Documentation

on:
pull_request:
paths-ignore:
- 'README.md'
push:
paths-ignore:
- 'README.md'
branches:
- 'main'
- 'release-'
tags: '*'

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: ["1"]
julia-arch: [x86]
os: [ubuntu-latest]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}
- name: Cache artifacts
version: '1'
- name: CacheArtifacts
uses: actions/cache@v4
env:
cache-name: cache-artifacts
Expand All @@ -31,13 +31,17 @@ jobs:
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- name: Install dependencies
- name: InstallDependencies
run: |
julia --project=docs/ -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
ENV["JULIA_PKG_SERVER"] = ""
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- name: BuildAndDeploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# https://juliadocs.github.io/Documenter.jl/stable/man/hosting/#Authentication:-GITHUB_TOKEN
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
run: julia --project=docs/ docs/make.jl
13 changes: 13 additions & 0 deletions .github/workflows/SpellCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Spell Check

on: [pull_request]

jobs:
typos-check:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4
- name: Check spelling
uses: crate-ci/typos@master
4 changes: 3 additions & 1 deletion .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: TagBot

on:
issue_comment:
types:
- created
workflow_dispatch:

jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
Expand All @@ -12,4 +14,4 @@ jobs:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.COMPATHELPER_PRIV }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
15 changes: 15 additions & 0 deletions .github/workflows/UnitTest.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ jobs:
with:
version: ${{ matrix.version }}

- name: Cache artifacts
uses: actions/cache@v4
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 }}-
# - name: "Unit Test"
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
Expand All @@ -43,3 +55,6 @@ jobs:
if: ${{ matrix.version == '1' && matrix.os == 'ubuntu-latest' }}
with:
file: lcov.info
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/clean.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# https://juliadocs.github.io/Documenter.jl/stable/man/hosting/#gh-pages-Branch

name: DocPreviewCleanup

on:
pull_request:
types: [closed]

jobs:
doc-preview-cleanup:
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages
- name: Delete preview and history + push changes
run: |
if [ -d "previews/PR$PRNUM" ]; then
git config user.name "Documenter.jl"
git config user.email "[email protected]"
git rm -rf "previews/PR$PRNUM"
git commit -m "delete preview"
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
git push --force origin gh-pages-new:gh-pages
fi
env:
PRNUM: ${{ github.event.number }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@ deps/src/
# Build artifacts for creating documentation generated by the Documenter package
docs/build/
docs/site/
docs/src/generated/

# File generated by Pkg, the package manager, based on a corresponding Project.toml
# It records a fixed state of all packages used by the project. As such, it should not be
# committed for packages, but should be committed for applications that require a static
# environment.
Manifest.toml

# other
.DS_Store
.*.*.swp
.benchmarkci
64 changes: 40 additions & 24 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,29 +1,45 @@
# push!(LOAD_PATH,"../src/")

using AVSfldIO
using Documenter

DocMeta.setdocmeta!(AVSfldIO, :DocTestSetup, :(using AVSfldIO); recursive=true)

makedocs(;
modules = [AVSfldIO],
authors = "Jeff Fessler <[email protected]> and contributors",
# repo = "https://github.com/JuliaIO/AVSfldIO.jl/blob/{commit}{path}#{line}",
sitename = "AVSfldIO.jl",
format = Documenter.HTML(;
prettyurls = get(ENV, "CI", "false") == "true",
# canonical = "https://JuliaIO.github.io/AVSfldIO.jl/stable",
# assets = String[],
),
execute = isempty(ARGS) || ARGS[1] == "run"

org, reps = :JuliaIO, :AVSfldIO
eval(:(using $reps))
import Documenter
#import Literate

base = "$org/$reps.jl"


repo = eval(:($reps))
Documenter.DocMeta.setdocmeta!(repo, :DocTestSetup, :(using $reps); recursive=true)


isci = get(ENV, "CI", nothing) == "true"

format = Documenter.HTML(;
prettyurls = isci,
edit_link = "main",
canonical = "https://$org.github.io/$repo.jl/stable/",
assets = ["assets/custom.css"],
)

Documenter.makedocs(;
modules = [repo],
authors = "Jeff Fessler and contributors",
sitename = "$repo.jl",
format,
pages = [
"Home" => "index.md",
"Methods" => "methods.md",
],
)

deploydocs(;
repo = "github.com/JuliaIO/AVSfldIO.jl.git",
devbranch = "main",
# devurl = "dev",
# versions = ["stable" => "v^", "dev" => "dev"],
# push_preview = true,
)
if isci
Documenter.deploydocs(;
repo = "github.com/$base",
devbranch = "main",
devurl = "dev",
versions = ["stable" => "v^", "dev" => "dev"],
forcepush = true,
# push_preview = true,
# see https://$org.github.io/$repo.jl/previews/PR##
)
end
3 changes: 3 additions & 0 deletions docs/src/assets/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.docs-sourcelink {
opacity:1 !important;
}
11 changes: 0 additions & 11 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,3 @@ CurrentModule = AVSfldIO
File I/O routines for AVS `.fld` format data files;
see
[(AVSfldIO)](https://github.com/JuliaIO/AVSfldIO.jl)

## Index

```@index
```

## Functions

```@autodocs
Modules = [AVSfldIO]
```
10 changes: 10 additions & 0 deletions docs/src/methods.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Methods list

```@index
```

## Methods usage

```@autodocs
Modules = [AVSfldIO]
```

0 comments on commit 65a928c

Please sign in to comment.