diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6804013..a3bd0bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,54 +1,41 @@ name: CI on: - pull_request: + push: branches: - main + pull_request: + types: [opened, synchronize, reopened] + +permissions: + actions: write + contents: read jobs: test: - runs-on: ${{ matrix.os }} + runs-on: + labels: cuda strategy: - matrix: - os: [ubuntu-latest, windows-latest, self-hosted] + matrix: + julia-version: ['1'] steps: - name: Checkout repository uses: actions/checkout@v4 - - - name: Set up Julia - uses: julia-actions/setup-julia@v2 + - uses: julia-actions/install-juliaup@v2 with: - version: '1.11' - + channel: ${{ matrix.julia-version }} - name: Cache Julia artifacts uses: actions/cache@v3 - with: - path: ~/.julia/artifacts - key: artifacts-${{ runner.os }}-${{ hashFiles('**/Project.toml') }}-${{ hashFiles('**/Manifest.toml') }} - restore-keys: artifacts-${{ runner.os }}- - - - name: Cache Julia packages - uses: actions/cache@v3 - with: - path: ~/.julia/compiled - key: compiled-${{ runner.os }}-${{ hashFiles('**/Project.toml') }}-${{ hashFiles('**/Manifest.toml') }} - restore-keys: compiled-${{ runner.os }}- - - - - name: Install package dependencies - run: | - julia --project=. -e 'using Pkg; Pkg.add(PackageSpec(url="https://github.com/lanl-ansi/GOC3Benchmark.jl")); Pkg.instantiate(); Pkg.precompile()' - - - name: Check for CUDA availability - id: check-cuda - shell: bash - run: | - if command -v nvidia-smi &> /dev/null; then - echo "cuda=true" >> $GITHUB_OUTPUT - else - echo "cuda=false" >> $GITHUB_OUTPUT - fi - - name: Run tests + shell: julia --project=. --color=yes {0} run: | - julia --project=. -e 'using Pkg; Pkg.test(; test_args=["cuda=${{ steps.check-cuda.outputs.cuda }}"])' \ No newline at end of file + using Pkg; + Pkg.Registry.update() + Pkg.test(; coverage=true) + - uses: julia-actions/julia-processcoverage@v1 + with: + directories: src + - uses: codecov/codecov-action@v5 + with: + file: lcov.info + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index d2fc95a..1e9b4b2 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -11,15 +11,24 @@ jobs: build: runs-on: labels: cuda + strategy: + matrix: + julia-version: ['1'] steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@latest + - uses: actions/checkout@v4 + - uses: julia-actions/install-juliaup@v2 with: - version: '1' - - name: Install dependencies - run: julia --project=docs/ -e 'using Pkg; Pkg.add(PackageSpec(url="https://github.com/lanl-ansi/GOC3Benchmark.jl")); Pkg.Registry.update(); Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate(); Pkg.precompile()' - - name: Build and deploy + channel: ${{ matrix.julia-version }} + - name: Cache Julia artifacts + uses: actions/cache@v3 + - name: Instantiate the dependencies + shell: julia --project=docs/ --color=yes {0} + run: | + using Pkg; + Pkg.Registry.update(); + Pkg.instantiate(); + - name: Build and deploy documentation 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/make.jl + run: julia --project=docs/ --color=yes docs/make.jl diff --git a/Project.toml b/Project.toml index 1d75bf8..e9a854d 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,5 @@ name = "ExaModelsPower" uuid = "2fff4b78-0b6c-428d-bac8-85ccea8c4bdf" -authors = ["Sungho Shin "] version = "0.1.0" [deps] @@ -17,7 +16,7 @@ Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6" ExaModels = "~0.9" PowerModels = "~0.21" JLD2 = "~0.5" -CUDA = "~5" +CUDA = "5 - 5.8.2" MadNLP = "~0.8" MadNLPGPU = "~0.7" @@ -33,3 +32,6 @@ NLPModelsJuMP = "792afdf1-32c1-5681-94e0-d7bf7a5df49e" [targets] test = ["Test", "MadNLP", "MadNLPGPU", "KernelAbstractions", "CUDA", "Ipopt", "JuMP", "NLPModelsJuMP"] + +[sources] +GOC3Benchmark = {url = "https://github.com/lanl-ansi/GOC3Benchmark.jl", rev = "588f356"} diff --git a/README.md b/README.md index 3a94602..f024ebc 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ # ExaModelsPower.jl ExaModelsPower.jl is an optimal power flow models using ExaModels.jl -![CI](https://github.com/exanauts/ExaModelsPower.jl/actions/workflows/ci.yml/badge.svg) +[![CI](https://github.com/MadNLP/ExaModelsPower.jl/actions/workflows/ci.yml/badge.svg)](https://github.com/MadNLP/ExaModelsPower.jl/actions/workflows/ci.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) -[![doc](https://img.shields.io/badge/docs-stable-blue.svg)](https://exanauts.github.io/ExaModelsPower.jl/stable) -[![doc](https://img.shields.io/badge/docs-dev-blue.svg)](https://exanauts.github.io/ExaModelsPower.jl/dev) +[![doc](https://img.shields.io/badge/docs-stable-blue.svg)](https://madsuite.org/ExaModelsPower.jl/stable/) +[![doc](https://img.shields.io/badge/docs-dev-blue.svg)](https://madsuite.org/ExaModelsPower.jl/dev/) +[![codecov](https://codecov.io/gh/MadNLP/ExaModelsPower.jl/graph/badge.svg?token=ybOObxcXhB)](https://codecov.io/gh/MadNLP/ExaModelsPower.jl) ## Usage ### Static optimal power flow diff --git a/docs/Project.toml b/docs/Project.toml index 80182ed..2d90f1a 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -6,3 +6,10 @@ CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306" MadNLP = "2621e9c9-9eb4-46b1-8089-e8c72242dfb6" MadNLPGPU = "d72a61cc-809d-412f-99be-fd81f4b8a598" +ExaModelsPower = "2fff4b78-0b6c-428d-bac8-85ccea8c4bdf" + +[compat] +CUDA = "5 - 5.8.2" + +[sources] +ExaModelsPower = {path = ".."}