Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 24 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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 }}"])'
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 }}
23 changes: 16 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 4 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name = "ExaModelsPower"
uuid = "2fff4b78-0b6c-428d-bac8-85ccea8c4bdf"
authors = ["Sungho Shin <[email protected]>"]
version = "0.1.0"

[deps]
Expand All @@ -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"

Expand All @@ -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"}
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 7 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ".."}
Loading