Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI #112

Merged
merged 3 commits into from
Jun 13, 2024
Merged

CI #112

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
45 changes: 45 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI
on:
pull_request:
branches:
- main
push:
branches:
- main

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
test:
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- "1"
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
- uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- name: Run all the scripts
run: julia --color=yes --project=code -e 'using Pkg; Pkg.instantiate(); include("code/run_all_scripts.jl")'
2 changes: 2 additions & 0 deletions code/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
SciMLSensitivity = "1ed8b502-d754-442c-8d5d-10ac956f44a1"
Tullio = "bc48ee85-29a4-5162-ae0b-a64e1601d4bc"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
Expand All @@ -22,6 +23,7 @@ OrdinaryDiffEq = "6.82"
Plots = "1.40"
RecursiveArrayTools = "3.23"
ReverseDiff = "1.15.3"
SafeTestsets = "0.1.0"
SciMLSensitivity = "7.61"
Tullio = "0.3.7"
Zygote = "0.6.70"
Expand Down
2 changes: 0 additions & 2 deletions code/SolverMethods/2DHeatEquation.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# using Pkg; Pkg.activate("../../."); Pkg.instantiate()

using Plots; gr()
using Statistics
using LinearAlgebra
Expand Down
22 changes: 22 additions & 0 deletions code/run_all_scripts.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using SafeTestsets, Test

function recursive_readdir!(cur_dir, path, list_of_scripts)
fullpath = joinpath(cur_dir, path)
if isdir(fullpath)
for entry in readdir(fullpath)
recursive_readdir!(fullpath, entry, list_of_scripts)
end
end
endswith(path, ".jl") && (fullpath != @__FILE__) && push!(list_of_scripts, fullpath)
return
end

scripts = []
recursive_readdir!(@__DIR__, "", scripts)

@testset "DiffEqSensitivity Review All Scripts" begin
for script in scripts
@info "Running $script"
@time @eval @safetestset $script begin include($script) end
end
end
Loading