From edd294af2758fbd53c4da2635c9f413e26ebdd8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20R=C3=A4ss?= <61313342+luraess@users.noreply.github.com> Date: Thu, 8 Feb 2024 18:17:58 +0100 Subject: [PATCH] Add meta (#1) This PR adds CI, docs, license file, and testing infrastructure. --- .buildkite/pipeline.yml | 15 ++++++ .buildkite/run_tests.yml | 56 +++++++++++++++++++++ .codecov.yml | 10 ++++ .github/dependabot.yml | 7 +++ .github/workflows/CompatHelper.yml | 16 ++++++ .github/workflows/Documentation.yml | 26 ++++++++++ .github/workflows/TagBot.yml | 18 +++++++ .github/workflows/UnitTests.yml | 68 +++++++++++++++++++++++++ .gitignore | 7 +++ LICENSE | 21 ++++++++ Project.toml | 2 +- README.md | 14 ++++++ docs/.gitignore | 2 + docs/Project.toml | 5 ++ docs/make.jl | 26 ++++++++++ docs/src/assets/logo.png | Bin 0 -> 4443 bytes docs/src/index.md | 5 ++ docs/src/lib/modules.md | 50 +++++++++++++++++++ docs/src/usage/runtests.md | 27 ++++++++++ ext/ChmyAMDGPUExt/ChmyAMDGPUExt.jl | 10 ++++ ext/ChmyCUDAExt/ChmyCUDAExt.jl | 10 ++++ test/Project.toml | 13 +++++ test/common.jl | 15 ++++++ test/runtests.jl | 74 ++++++++++++++++++++++++++++ test/test_fields.jl | 54 ++++++++++++++++++++ 25 files changed, 550 insertions(+), 1 deletion(-) create mode 100644 .buildkite/pipeline.yml create mode 100644 .buildkite/run_tests.yml create mode 100644 .codecov.yml create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/CompatHelper.yml create mode 100644 .github/workflows/Documentation.yml create mode 100644 .github/workflows/TagBot.yml create mode 100644 .github/workflows/UnitTests.yml create mode 100644 LICENSE create mode 100644 README.md create mode 100644 docs/.gitignore create mode 100644 docs/Project.toml create mode 100644 docs/make.jl create mode 100644 docs/src/assets/logo.png create mode 100644 docs/src/index.md create mode 100644 docs/src/lib/modules.md create mode 100644 docs/src/usage/runtests.md create mode 100644 test/Project.toml create mode 100644 test/common.jl create mode 100644 test/test_fields.jl diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml new file mode 100644 index 00000000..5a74e483 --- /dev/null +++ b/.buildkite/pipeline.yml @@ -0,0 +1,15 @@ +# see: https://github.com/staticfloat/forerunner-buildkite-plugin +steps: + - label: ":runner: Dynamically launch Pipelines" + plugins: + - staticfloat/forerunner: + watch: + - ".buildkite/run_tests.yml" + - ".buildkite/pipeline.yml" + - "**/*.toml" + - "src/**" + - "ext/**" + - "test/**" + target: ".buildkite/run_tests.yml" + agents: + queue: "juliagpu" diff --git a/.buildkite/run_tests.yml b/.buildkite/run_tests.yml new file mode 100644 index 00000000..390bc152 --- /dev/null +++ b/.buildkite/run_tests.yml @@ -0,0 +1,56 @@ +steps: + - label: "CUDA Julia {{matrix.version}}" + matrix: + setup: + version: + - "1.9" + - "1.10" + plugins: + - JuliaCI/julia#v1: + version: "{{matrix.version}}" + - JuliaCI/julia-coverage#v1: + codecov: true + command: | + julia -e 'println("--- :julia: Instantiating project") + using Pkg + Pkg.develop(; path=pwd())' || exit 3 + + julia -e 'println("+++ :julia: Running tests") + using Pkg + Pkg.test("Chmy"; test_args=["--backend=CUDA"], coverage=true)' + agents: + queue: "juliagpu" + cuda: "*" + timeout_in_minutes: 120 + soft_fail: + - exit_status: 3 + + - label: "AMDGPU Julia {{matrix.version}}" + matrix: + setup: + version: + - "1.10" + plugins: + - JuliaCI/julia#v1: + version: "{{matrix.version}}" + - JuliaCI/julia-coverage#v1: + codecov: true + command: | + julia -e 'println("--- :julia: Instantiating project") + using Pkg + Pkg.develop(; path=pwd())' || exit 3 + + julia -e 'println("+++ :julia: Running tests") + using Pkg + Pkg.test("Chmy"; test_args=["--backend=AMDGPU"], coverage=true)' + agents: + queue: "juliagpu" + rocm: "*" + rocmgpu: "gfx1101" # select Ludovic's Navi 3 card (ROCm 6.0) + timeout_in_minutes: 120 + soft_fail: + - exit_status: 3 + env: + JULIA_NUM_THREADS: 4 +env: + SECRET_CODECOV_TOKEN: "D2H/GglFTcK7SKyfuO/Fy34xrVWHzXbtGTGQXAA3wpEPNAATGhHO/mIm0ILLzhMZSI1LplJBxJ7nV5WVsky0e/01nbSnW5iB0QqFHK8rD+lXUr4ls4zMlyUa0Lvsl/HixFyhwBtFhy8ruwUsqN8AbJNSJSiF9x4jXhzTgIvlO25/HqQObcfJa6qwcw0m9uMa3K26w1xrPhdE7F4mdUUREjB1W8dzfkKF+vZUeMqYFKgit21uQ9QsRjDJl0ExOEw0SC910rtGHtDO0bpIe+D1nEGQsQr8VEN3o0hOCgTJrya8MFitBqkKeVBV/NUImu4UtxlNb7r0ZrjTawiFle2tfg==;U2FsdGVkX1+sdgrm8OBTX9elIdJMwLMpOvXFFtHrG9lj5J8qDBdbjJDva3XMXkbF6I4PCh9G9NW0pEcF9ghb7g==" diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 00000000..6aa5b2cd --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,10 @@ +coverage: + status: + patch: + default: + informational: true + project: + default: + informational: true + changes: false +comment: false diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..d60f0707 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +# 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 + schedule: + interval: "monthly" diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml new file mode 100644 index 00000000..992cf229 --- /dev/null +++ b/.github/workflows/CompatHelper.yml @@ -0,0 +1,16 @@ +name: CompatHelper +on: + schedule: + - cron: 0 0 * * * + workflow_dispatch: +jobs: + CompatHelper: + runs-on: ubuntu-latest + steps: + - name: Pkg.add("CompatHelper") + run: julia -e 'using Pkg; Pkg.add("CompatHelper")' + - name: CompatHelper.main() + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }} + run: julia -e 'using CompatHelper; CompatHelper.main()' \ No newline at end of file diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml new file mode 100644 index 00000000..8c62080f --- /dev/null +++ b/.github/workflows/Documentation.yml @@ -0,0 +1,26 @@ +name: Documentation + +on: + push: + branches: + - lr/doc-ci # update to match your development branch (master, main, dev, trunk, ...) + tags: '*' + pull_request: + +jobs: + build: + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v1 + with: + version: '1.10' + - 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/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml new file mode 100644 index 00000000..74e8da8a --- /dev/null +++ b/.github/workflows/TagBot.yml @@ -0,0 +1,18 @@ +name: TagBot + +on: + issue_comment: + types: + - created + workflow_dispatch: + +jobs: + TagBot: + if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' + runs-on: ubuntu-latest + steps: + - uses: JuliaRegistries/TagBot@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + ssh: ${{ secrets.DOCUMENTER_KEY }} + draft: true \ No newline at end of file diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml new file mode 100644 index 00000000..54951fac --- /dev/null +++ b/.github/workflows/UnitTests.yml @@ -0,0 +1,68 @@ +name: Unit Tests +on: + push: + branches: + - main + paths: + - '.github/workflows/UnitTests.yml' + - '**/*.toml' + - 'src/**' + - 'ext/**' + - 'test/**' + pull_request: + paths: + - '.github/workflows/UnitTests.yml' + - '**/*.toml' + - 'src/**' + - 'ext/**' + - 'test/**' +env: + JULIA_NUM_THREADS: 2 +jobs: + test: + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + version: + - '1.9' + - '1' # Latest stable 1.x release of Julia + os: + - ubuntu-latest + - macOS-latest + - windows-latest + arch: + - x64 + include: + - os: macos-14 + arch: "aarch64" + version: "1" + # include: + # - version: 'nightly' + # os: ubuntu-latest + # arch: x64 + # allow_failure: true + steps: + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + - 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 }}- + - uses: julia-actions/julia-buildpkg@latest + - uses: julia-actions/julia-runtest@latest + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: false # or true if you want CI to fail when Codecov fails diff --git a/.gitignore b/.gitignore index ba39cc53..cff04407 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,8 @@ +docs/build/ +docs/site/ + Manifest.toml +LocalPreferences.toml + +.DS_Store +.vscode diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..5b022522 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Pseudo-Transient solvers + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Project.toml b/Project.toml index 6166e0bc..99b4d1c6 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "Chmy" uuid = "33a72cf0-4690-46d7-b987-06506c2248b9" -authors = ["Ivan Utkin "] +authors = ["Ivan Utkin , Ludovic Raess , and contributors"] version = "0.1.0" [deps] diff --git a/README.md b/README.md new file mode 100644 index 00000000..5c3f0ee2 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +

Chmy.jl Chmy.jl

+ +[![Docs](https://img.shields.io/badge/docs-dev-blue.svg)](https://PTsolvers.github.io/Chmy.jl/dev) +[![CPU CI](https://github.com/PTsolvers/Chmy.jl/actions/workflows/UnitTests.yml/badge.svg)](https://github.com/PTsolvers/Chmy.jl/actions/workflows/UnitTests.yml) +[![GPU CI](https://badge.buildkite.com/3cfbc1f4a0553ce2281925dec2bceba9446bb429286621ec92.svg)](https://buildkite.com/julialang/chmy-dot-jl) +[![codecov](https://codecov.io/gh/PTsolvers/Chmy.jl/graph/badge.svg?token=GMQZHJD807)](https://codecov.io/gh/PTsolvers/Chmy.jl) + +Hey, that's Chmy.jl 🚀 + +## Documentation +Checkout the [documentation](https://PTsolvers.github.io/Chmy.jl/dev) for API reference and usage. + +## Funding +The development of this package is supported by the [GPU4GEO](https://ptsolvers.github.io/GPU4GEO/) [PASC](https://www.pasc-ch.org) project. diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 00000000..a303fff2 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,2 @@ +build/ +site/ diff --git a/docs/Project.toml b/docs/Project.toml new file mode 100644 index 00000000..1814eb33 --- /dev/null +++ b/docs/Project.toml @@ -0,0 +1,5 @@ +[deps] +Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" + +[compat] +Documenter = "1" diff --git a/docs/make.jl b/docs/make.jl new file mode 100644 index 00000000..25b3e966 --- /dev/null +++ b/docs/make.jl @@ -0,0 +1,26 @@ +using Documenter +using Chmy + +push!(LOAD_PATH,"../src/") + +makedocs( + sitename = "Chmy", + authors="Ivan Utkin, Ludovic Räss and contributors", + format = Documenter.HTML( + prettyurls=get(ENV, "CI", nothing) == "true", # easier local build + ansicolor=true + ), + modules = [Chmy], + warnonly = [:missing_docs], + pages = Any[ + "Home" => "index.md", + "Usage" => Any["usage/runtests.md"], + "Library" => Any["lib/modules.md"] + ] +) + +deploydocs( + repo = "github.com/PTsolvers/Chmy.jl.git", + devbranch = "lr/doc-ci", + push_preview = true +) diff --git a/docs/src/assets/logo.png b/docs/src/assets/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..a5048ba64f57f06105865c7bc1833924285287ae GIT binary patch literal 4443 zcmd^DX;f2L628c^0bFRbl_(nQHi$DSpeUdiB8ZLYXs{QXW|5=;#RUzr7!8C(0U4D= zUt0D>v_V@9$|g(5qKs$`V4~3=LI{j3K_F2~2n0grW={W`bEbdUKW2X1_fA#ay7f-g zS5>#(g?%Ky1y;+g000XJyM4a{z)Wvi7IPs-y(E(WUzX9k17iW0x5%{2UdWSX0I*p= z@b&)Tbm5p>Knl_ETl(CuBqUY{>#uMAY_HY2XtT9FW$PA;5QqFRX;9Vn6(jZXo{X~H z+4Gld25I~A!05;CAV`S#HrKxxWkkH%*eT{>?p z*eUp+=}bfj zffZ40&H!Z>4=ae@FdIgWyRIgE@FbjIv~B{u-|>i5GY(<}(@kUNU$Wtl{u~fDn+u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