Skip to content

Commit 158fa82

Browse files
authored
Merge pull request #302 from JuliaDynamics/hw/pd_downstream_test
downstream tests for PowerDynamics
2 parents b0810e5 + 9ccb366 commit 158fa82

File tree

2 files changed

+31
-29
lines changed

2 files changed

+31
-29
lines changed

.github/workflows/tests.yml

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ jobs:
139139
${{ steps.julia-cache.outputs.cache-paths }}
140140
key: ${{ steps.julia-cache.outputs.cache-key }}
141141

142-
OpPoDyn-test:
143-
name: OpPoDyn.jl test - Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
142+
PowerDynamics-test:
143+
name: PowerDynamics.jl test - Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
144144
runs-on: ${{ matrix.os }}
145145
permissions:
146146
actions: write # needed to allow julia-actions/cache to proactively delete old caches that it has created
@@ -165,7 +165,7 @@ jobs:
165165
- name: Load Julia packages from cache
166166
id: julia-cache
167167
uses: julia-actions/cache@v2
168-
- name: Extract OpPoDyn branch from PR
168+
- name: Extract PowerDynamics branch from PR
169169
id: extract-branch
170170
run: |
171171
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
@@ -177,41 +177,43 @@ jobs:
177177
# Combine title and body for searching
178178
PR_TEXT="$PR_TITLE $PR_BODY"
179179
180-
# Look for [oppodyn:branch-name] pattern (case insensitive)
181-
BRANCH_MATCH=$(echo "$PR_TEXT" | grep -i -o "\[oppodyn:[^]]*\]" | head -n1)
180+
# Look for [powerdynamics:branch-name] pattern (case insensitive)
181+
BRANCH_MATCH=$(echo "$PR_TEXT" | grep -i -o "\[powerdynamics:[^]]*\]" | head -n1)
182182
if [[ -n "$BRANCH_MATCH" ]]; then
183-
BRANCH_NAME=$(echo "$BRANCH_MATCH" | sed 's/\[[Oo][Pp][Pp][Oo][Dd][Yy][Nn]:\([^]]*\)\]/\1/i')
184-
echo "Found OpPoDyn branch specification: $BRANCH_NAME"
185-
echo "oppodyn_branch=$BRANCH_NAME" >> $GITHUB_OUTPUT
183+
BRANCH_NAME=$(echo "$BRANCH_MATCH" | sed 's/\[[Pp][Oo][Ww][Ee][Rr][Dd][Yy][Nn][Aa][Mm][Ii][Cc][Ss]:\([^]]*\)\]/\1/i')
184+
echo "Found PowerDynamics branch specification: $BRANCH_NAME"
185+
echo "powerdynamics_branch=$BRANCH_NAME" >> $GITHUB_OUTPUT
186186
else
187-
echo "No OpPoDyn branch specified, using main"
188-
echo "oppodyn_branch=main" >> $GITHUB_OUTPUT
187+
echo "No PowerDynamics branch specified, using main"
188+
echo "powerdynamics_branch=main" >> $GITHUB_OUTPUT
189189
fi
190190
else
191191
echo "Not a pull request, using main branch"
192-
echo "oppodyn_branch=main" >> $GITHUB_OUTPUT
192+
echo "powerdynamics_branch=main" >> $GITHUB_OUTPUT
193193
fi
194194
- uses: actions/checkout@v4
195195
with:
196-
repository: JuliaEnergy/OpPoDyn.jl
197-
ref: ${{ steps.extract-branch.outputs.oppodyn_branch }}
198-
path: OpPoDyn
199-
- name: Run OpPoDyn tests
200-
shell: julia --project=testenv --color=yes {0}
196+
repository: JuliaEnergy/PowerDynamics.jl
197+
ref: ${{ steps.extract-branch.outputs.powerdynamics_branch }}
198+
path: PowerDynamics
199+
- name: Run PowerDynamics tests
200+
shell: julia --project=PowerDynamics/docs --color=yes {0}
201201
run: |
202202
using Pkg
203-
try
204-
pkg"dev ."
205-
pkg"dev ./OpPoDyn"
206-
pkg"dev ./OpPoDyn/OpPoDynTesting"
207-
Pkg.test("OpPoDyn"; coverage=false)
208-
catch e
209-
if e isa Pkg.Resolve.ResolverError
210-
@info "Resolve error! No need to test a breaking release..." e
211-
exit(0)
212-
else
213-
rethrow(e)
214-
end
203+
using Test
204+
pkg"dev ."
205+
@testset "PowerDynamics Downstream Tests" begin
206+
@testset "Normal Package tests" begin
207+
Pkg.test("PowerDynamics"; coverage=false)
208+
end
209+
@testset "Documentation Example Tests" begin
210+
examples = abspath(joinpath("PowerDynamics", "docs", "examples"))
211+
for file in readdir(examples; join=true)
212+
endswith(file, ".jl") || continue
213+
@info "Test example $file"
214+
include(file)
215+
end
216+
end
215217
end
216218
- name: Save Julia depot cache on cancel or failure
217219
id: julia-cache-save

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ KernelAbstractions = "0.9.18"
6767
LinearAlgebra = "1"
6868
MacroTools = "0.5.15"
6969
Mixers = "0.1.2"
70-
ModelingToolkit = "9.67"
70+
ModelingToolkit = "9.82"
7171
NNlib = "0.9.13"
7272
NonlinearSolve = "4"
7373
OrderedCollections = "1.8.0"

0 commit comments

Comments
 (0)