Skip to content

Commit 6af678a

Browse files
authored
CI and Project.toml update (#17)
1 parent b97bfb3 commit 6af678a

File tree

5 files changed

+55
-49
lines changed

5 files changed

+55
-49
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,41 @@
11
name: CI
22

33
on:
4-
pull_request:
4+
push:
55
branches:
66
- main
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
10+
permissions:
11+
actions: write
12+
contents: read
713

814
jobs:
915
test:
10-
runs-on: ${{ matrix.os }}
16+
runs-on:
17+
labels: cuda
1118
strategy:
12-
matrix:
13-
os: [ubuntu-latest, windows-latest, self-hosted]
19+
matrix:
20+
julia-version: ['1']
1421
steps:
1522
- name: Checkout repository
1623
uses: actions/checkout@v4
17-
18-
- name: Set up Julia
19-
uses: julia-actions/setup-julia@v2
24+
- uses: julia-actions/install-juliaup@v2
2025
with:
21-
version: '1.11'
22-
26+
channel: ${{ matrix.julia-version }}
2327
- name: Cache Julia artifacts
2428
uses: actions/cache@v3
25-
with:
26-
path: ~/.julia/artifacts
27-
key: artifacts-${{ runner.os }}-${{ hashFiles('**/Project.toml') }}-${{ hashFiles('**/Manifest.toml') }}
28-
restore-keys: artifacts-${{ runner.os }}-
29-
30-
- name: Cache Julia packages
31-
uses: actions/cache@v3
32-
with:
33-
path: ~/.julia/compiled
34-
key: compiled-${{ runner.os }}-${{ hashFiles('**/Project.toml') }}-${{ hashFiles('**/Manifest.toml') }}
35-
restore-keys: compiled-${{ runner.os }}-
36-
37-
38-
- name: Install package dependencies
39-
run: |
40-
julia --project=. -e 'using Pkg; Pkg.add(PackageSpec(url="https://github.com/lanl-ansi/GOC3Benchmark.jl")); Pkg.instantiate(); Pkg.precompile()'
41-
42-
- name: Check for CUDA availability
43-
id: check-cuda
44-
shell: bash
45-
run: |
46-
if command -v nvidia-smi &> /dev/null; then
47-
echo "cuda=true" >> $GITHUB_OUTPUT
48-
else
49-
echo "cuda=false" >> $GITHUB_OUTPUT
50-
fi
51-
5229
- name: Run tests
30+
shell: julia --project=. --color=yes {0}
5331
run: |
54-
julia --project=. -e 'using Pkg; Pkg.test(; test_args=["cuda=${{ steps.check-cuda.outputs.cuda }}"])'
32+
using Pkg;
33+
Pkg.Registry.update()
34+
Pkg.test(; coverage=true)
35+
- uses: julia-actions/julia-processcoverage@v1
36+
with:
37+
directories: src
38+
- uses: codecov/codecov-action@v5
39+
with:
40+
file: lcov.info
41+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/docs.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,24 @@ jobs:
1111
build:
1212
runs-on:
1313
labels: cuda
14+
strategy:
15+
matrix:
16+
julia-version: ['1']
1417
steps:
15-
- uses: actions/checkout@v2
16-
- uses: julia-actions/setup-julia@latest
18+
- uses: actions/checkout@v4
19+
- uses: julia-actions/install-juliaup@v2
1720
with:
18-
version: '1'
19-
- name: Install dependencies
20-
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()'
21-
- name: Build and deploy
21+
channel: ${{ matrix.julia-version }}
22+
- name: Cache Julia artifacts
23+
uses: actions/cache@v3
24+
- name: Instantiate the dependencies
25+
shell: julia --project=docs/ --color=yes {0}
26+
run: |
27+
using Pkg;
28+
Pkg.Registry.update();
29+
Pkg.instantiate();
30+
- name: Build and deploy documentation
2231
env:
2332
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
2433
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key
25-
run: julia --project=. docs/make.jl
34+
run: julia --project=docs/ --color=yes docs/make.jl

Project.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name = "ExaModelsPower"
22
uuid = "2fff4b78-0b6c-428d-bac8-85ccea8c4bdf"
3-
authors = ["Sungho Shin <[email protected]>"]
43
version = "0.1.0"
54

65
[deps]
@@ -17,7 +16,7 @@ Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
1716
ExaModels = "~0.9"
1817
PowerModels = "~0.21"
1918
JLD2 = "~0.5"
20-
CUDA = "~5"
19+
CUDA = "5 - 5.8.2"
2120
MadNLP = "~0.8"
2221
MadNLPGPU = "~0.7"
2322

@@ -33,3 +32,6 @@ NLPModelsJuMP = "792afdf1-32c1-5681-94e0-d7bf7a5df49e"
3332

3433
[targets]
3534
test = ["Test", "MadNLP", "MadNLPGPU", "KernelAbstractions", "CUDA", "Ipopt", "JuMP", "NLPModelsJuMP"]
35+
36+
[sources]
37+
GOC3Benchmark = {url = "https://github.com/lanl-ansi/GOC3Benchmark.jl", rev = "588f356"}

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# ExaModelsPower.jl
22
ExaModelsPower.jl is an optimal power flow models using ExaModels.jl
33

4-
![CI](https://github.com/exanauts/ExaModelsPower.jl/actions/workflows/ci.yml/badge.svg)
4+
[![CI](https://github.com/MadNLP/ExaModelsPower.jl/actions/workflows/ci.yml/badge.svg)](https://github.com/MadNLP/ExaModelsPower.jl/actions/workflows/ci.yml)
55
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
6-
[![doc](https://img.shields.io/badge/docs-stable-blue.svg)](https://exanauts.github.io/ExaModelsPower.jl/stable)
7-
[![doc](https://img.shields.io/badge/docs-dev-blue.svg)](https://exanauts.github.io/ExaModelsPower.jl/dev)
6+
[![doc](https://img.shields.io/badge/docs-stable-blue.svg)](https://madsuite.org/ExaModelsPower.jl/stable/)
7+
[![doc](https://img.shields.io/badge/docs-dev-blue.svg)](https://madsuite.org/ExaModelsPower.jl/dev/)
8+
[![codecov](https://codecov.io/gh/MadNLP/ExaModelsPower.jl/graph/badge.svg?token=ybOObxcXhB)](https://codecov.io/gh/MadNLP/ExaModelsPower.jl)
89

910
## Usage
1011
### Static optimal power flow

docs/Project.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,10 @@ CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
66
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
77
MadNLP = "2621e9c9-9eb4-46b1-8089-e8c72242dfb6"
88
MadNLPGPU = "d72a61cc-809d-412f-99be-fd81f4b8a598"
9+
ExaModelsPower = "2fff4b78-0b6c-428d-bac8-85ccea8c4bdf"
10+
11+
[compat]
12+
CUDA = "5 - 5.8.2"
13+
14+
[sources]
15+
ExaModelsPower = {path = ".."}

0 commit comments

Comments
 (0)