diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3d5ecd5..fedd296 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -52,3 +52,27 @@ jobs: - uses: codecov/codecov-action@v4 with: file: lcov.info + docs: + name: Documentation + runs-on: ${{ fromJSON('["ubuntu-latest", "self-hosted"]')[github.repository == 'github/docs-internal'] }} + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@v1 + with: + version: "1" + - run: | + julia --project=docs -e ' + using Pkg + Pkg.develop(PackageSpec(path=pwd())) + Pkg.instantiate()' + - run: | + julia --project=docs -e ' + using Documenter: doctest + using TrixiEnzyme # change MyAwesomePackage to the name of your package + doctest(TrixiEnzyme)' # change MyAwesomePackage to the name of your package + - run: julia --project=docs docs/make.jl + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v1 diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml new file mode 100644 index 0000000..5591e22 --- /dev/null +++ b/.github/workflows/Documentation.yml @@ -0,0 +1,29 @@ +name: Documentation +on: + push: + branches: + - main # update to match your development branch (master, main, dev, trunk, ...) + tags: "*" + pull_request: + +jobs: + build: + permissions: + actions: write + contents: write + pull-requests: read + statuses: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v2 + with: + version: "1" + - uses: julia-actions/cache@v2 + - name: Install dependencies + run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' + - name: Build and deploy + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key + run: julia --project=docs/ docs/make.jl diff --git a/.gitignore b/.gitignore index 38d09c7..85b7a25 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ **/Manifest.toml out*/ +docs/build .DS_Store diff --git a/.typos.toml b/.typos.toml index e3e12b9..0840da3 100644 --- a/.typos.toml +++ b/.typos.toml @@ -1,4 +1,4 @@ [files] extend-exclude = [ - "docs/dev_env_info.md" + "docs/src/dev_env_info.md" ] diff --git a/docs/Project.toml b/docs/Project.toml new file mode 100644 index 0000000..31c4695 --- /dev/null +++ b/docs/Project.toml @@ -0,0 +1,5 @@ +[deps] +Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" + +[extras] +Trixi = "a7f1ee26-1774-49b1-8366-f1abc58fbfcb" diff --git a/docs/make.jl b/docs/make.jl new file mode 100644 index 0000000..a995649 --- /dev/null +++ b/docs/make.jl @@ -0,0 +1,17 @@ +# TrixiCUDA.jl is not accessible through Julia's LOAD_PATH currently +push!(LOAD_PATH, "../src/") + +using Documenter +using TrixiCUDA + +# DocMeta.setdocmeta!(TrixiCUDA, :DocTestSetup, :(using TrixiCUDA); recursive = true) + +makedocs(sitename = "TrixiCUDA.jl", + # pages = [ + # "Home" => "index.md" + # ], + format = Documenter.HTML(prettyurls = get(ENV, "CI", nothing) == "true")) + +deploydocs(repo = "github.com/trixi-gpu/TrixiCUDA.jl", + devbranch = "main", + push_preview = true) diff --git a/docs/aws_gpu_setup.md b/docs/src/aws_gpu_setup.md similarity index 100% rename from docs/aws_gpu_setup.md rename to docs/src/aws_gpu_setup.md diff --git a/docs/dev_env_info.md b/docs/src/dev_env_info.md similarity index 100% rename from docs/dev_env_info.md rename to docs/src/dev_env_info.md diff --git a/docs/src/index.md b/docs/src/index.md new file mode 100644 index 0000000..de91950 --- /dev/null +++ b/docs/src/index.md @@ -0,0 +1 @@ +# TrixiCUDA.jl \ No newline at end of file diff --git a/docs/nsys_profiling.md b/docs/src/nsys_profiling.md similarity index 100% rename from docs/nsys_profiling.md rename to docs/src/nsys_profiling.md