Skip to content

Commit

Permalink
change: Split Examples out into their own CI run
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt-aws committed Jul 28, 2023
1 parent c43bc16 commit c11d949
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 38 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,47 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
examples:
name: Example notebooks
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
needs: [os-test, version-test]
strategy:
fail-fast: true
matrix:
group:
- Examples-unit
version: ['1.9']
arch: ['x64']
steps:
- uses: actions/checkout@v1
- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/julia-buildpkg@latest
- run: |
git config --global user.name Tester
git config --global user.email [email protected]
- name: "Dev PyBraket package"
run: |
julia --project -e 'using Pkg; Pkg.develop(path=joinpath(pwd(), "PyBraket"))'
- name: "Run tests"
uses: julia-actions/julia-runtest@v1
env:
JULIA_CONDAPKG_VERBOSITY: 2
BRAKET_CI: true
GROUP: ${{ matrix.group }}
- name: "Process coverage"
uses: julia-actions/julia-processcoverage@v1
with:
directories: src,PyBraket/src
- name: "Upload coverage"
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
docs:
name: Documentation
runs-on: ubuntu-latest
Expand Down
21 changes: 1 addition & 20 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,17 @@ AWSS3 = "=0.11.2"
Aqua = "=0.6"
AxisArrays = "=0.4.7"
CSV = "=0.10.11"
Cairo = "=1.0.5"
Colors = "=0.12.10"
Compat = "=4.7.0"
Compose = "=0.9.4"
CondaPkg = "=0.2.17"
Compat = "=4.8.0"
DataStructures = "=0.18.14"
DecFP = "=1.3.2"
Distributions = "=0.25.76"
GraphPlot = "=0.5.2"
Graphs = "=1.8.0"
HTTP = "=1.9.14"
JSON3 = "=1.13.1"
Markdown = "=0.7.5"
Mocking = "=0.7.6"
NLopt = "=0.6.5"
NamedTupleTools = "=0.14.3"
Optim = "=1.7.4"
OrderedCollections = "=1.6.2"
Plots = "=1.38.5"
SimpleWeightedGraphs = "=1.2.2"
StructTypes = "=1.10.0"
Tar = "1.9.3"
julia = "1.6"
Expand All @@ -63,28 +54,18 @@ julia = "1.6"
AWS = "fbe9abb3-538b-5e4e-ba9e-bc94f4f92ebc"
AWSS3 = "1c724243-ef5b-51ab-93f4-b0a88ac62a95"
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Cairo = "159f3aea-2a34-519c-b102-8c37f9878175"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
Compose = "a81c6b42-2e10-5240-aca2-a61377ecd94b"
CondaPkg = "992eb4ea-22a4-4c89-a5bb-47a3300528ab"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
DecFP = "55939f99-70c6-5e9b-8bb0-5071ed7d61fd"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
GraphPlot = "a2cc645c-3eea-5389-862e-a155d0052231"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Mocking = "78c3b35d-d492-501b-9361-3d52fe80e533"
NLopt = "76087f3c-5699-56af-9a33-bf431cd00edd"
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SimpleWeightedGraphs = "47aef6b3-ad0c-573a-a1e2-d07658019622"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4"
Expand Down
13 changes: 13 additions & 0 deletions examples/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[deps]
Braket = "19504a0f-b47d-4348-9127-acc6cc69ef67"
Cairo = "159f3aea-2a34-519c-b102-8c37f9878175"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
Compose = "a81c6b42-2e10-5240-aca2-a61377ecd94b"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
GraphPlot = "a2cc645c-3eea-5389-862e-a155d0052231"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
NLopt = "76087f3c-5699-56af-9a33-bf431cd00edd"
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
PyBraket = "e85266a6-1825-490b-a80e-9b9469c53660"
SimpleWeightedGraphs = "47aef6b3-ad0c-573a-a1e2-d07658019622"
11 changes: 0 additions & 11 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,18 @@ AWSS3 = "1c724243-ef5b-51ab-93f4-b0a88ac62a95"
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Braket = "19504a0f-b47d-4348-9127-acc6cc69ef67"
Cairo = "159f3aea-2a34-519c-b102-8c37f9878175"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
Compose = "a81c6b42-2e10-5240-aca2-a61377ecd94b"
CondaPkg = "992eb4ea-22a4-4c89-a5bb-47a3300528ab"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
DecFP = "55939f99-70c6-5e9b-8bb0-5071ed7d61fd"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
GraphPlot = "a2cc645c-3eea-5389-862e-a155d0052231"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Mocking = "78c3b35d-d492-501b-9361-3d52fe80e533"
NLopt = "76087f3c-5699-56af-9a33-bf431cd00edd"
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
PyBraket = "e85266a6-1825-490b-a80e-9b9469c53660"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SimpleWeightedGraphs = "47aef6b3-ad0c-573a-a1e2-d07658019622"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4"
Expand Down
20 changes: 13 additions & 7 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ function set_aws_creds(test_type)
end
end

groups = GROUP == "All" ? ["Braket-integ", "Braket-unit", "PyBraket-integ", "PyBraket-unit"] : GROUP
groups = GROUP == "All" ? ["Braket-integ", "Braket-unit", "PyBraket-integ", "PyBraket-unit", "Examples-unit", "Examples-integ"] : GROUP
groups = (groups isa String ? [groups] : groups)

subpackage_path(subpackage::String) = joinpath(dirname(@__DIR__), subpackage)
develop_subpackage(subpackage::String) = Pkg.develop(PackageSpec(; path=subpackage_path(subpackage)))

for group in groups
@info "Testing $group"
Expand Down Expand Up @@ -59,25 +62,28 @@ for group in groups
include("task_batch.jl")
include("local_jobs.jl")
include("jobs.jl")
elseif test_type == "integ"
include(joinpath(@__DIR__, "integ_tests", "runtests.jl"))
end
elseif pkg_name == "Examples"
Pkg.activate(joinpath(@__DIR__, "..", "examples"))
if test_type == "unit"
# test example notebooks that don't need AWS devices
@testset "Examples" begin
@testset "Local Examples" begin
include(joinpath(@__DIR__, "..", "examples", "ahs_rabi.jl"))
include(joinpath(@__DIR__, "..", "examples", "graph_coloring.jl"))
include(joinpath(@__DIR__, "..", "examples", "qft.jl"))
end
elseif test_type == "integ"
#=@testset "Examples" begin
@testset "Examples-integ" begin
# test example notebooks that do need AWS devices
include(joinpath(@__DIR__, "..", "examples", "adjoint_gradient.jl"))
include(joinpath(@__DIR__, "..", "examples", "ahs_nb.jl"))
include(joinpath(@__DIR__, "..", "examples", "vqe_chemistry.jl"))
include(joinpath(@__DIR__, "..", "examples", "tetris_vqe.jl"))
end=#
include(joinpath(@__DIR__, "integ_tests", "runtests.jl"))
end
end
else
subpackage_path(subpackage::String) = joinpath(dirname(@__DIR__), subpackage)
develop_subpackage(subpackage::String) = Pkg.develop(PackageSpec(; path=subpackage_path(subpackage)))
develop_subpackage(pkg_name)
subpkg_path = subpackage_path(pkg_name)
# this should inherit the GROUP envvar
Expand Down

0 comments on commit c11d949

Please sign in to comment.