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

Improve CI #166

Merged
merged 37 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e0efda8
Rename `CI` to `Tests`
sunxd3 Mar 24, 2024
6214109
a bit of formatting
sunxd3 Mar 24, 2024
1d412b2
update `checkout` and `cache` actions to v4
sunxd3 Mar 24, 2024
202d5c6
cache packages
sunxd3 Mar 24, 2024
08227e8
add CompatHelper
sunxd3 Mar 24, 2024
f8a0745
move `methadone` to `BUGSExample`, not enabled
sunxd3 Mar 24, 2024
96cf29d
remove `gradient_tests`
sunxd3 Mar 24, 2024
f63318e
rename BUGSExample folder name
sunxd3 Mar 24, 2024
78c1951
factorize tests into different CI tasks
sunxd3 Mar 24, 2024
71e5113
add Test_group to CI name
sunxd3 Mar 24, 2024
cb1d0ba
Update test/runtests.jl
sunxd3 Mar 24, 2024
fee107c
Update test/runtests.jl
sunxd3 Mar 24, 2024
49be6cb
propagate name changes
sunxd3 Mar 24, 2024
4224880
format
sunxd3 Mar 24, 2024
734c085
use retry for mcmcchains and gibbs
sunxd3 Mar 24, 2024
8eee5da
only trigger test run if changes are made to `src` and `test`
sunxd3 Mar 24, 2024
79e0ea9
bump version
sunxd3 Mar 24, 2024
9b05fb3
add extra clause: run all the tests
sunxd3 Mar 24, 2024
f57d767
use multiple steps instead of strategy
sunxd3 Mar 25, 2024
2153de1
update tests
sunxd3 Mar 25, 2024
49e71ff
fix error
sunxd3 Mar 25, 2024
a9862be
fix errors
sunxd3 Mar 25, 2024
cbe3a8c
add escape symbol
sunxd3 Mar 25, 2024
dc6f92a
fix error
sunxd3 Mar 25, 2024
a0cc28b
fix errors
sunxd3 Mar 25, 2024
78230c2
fix error
sunxd3 Mar 25, 2024
529f989
fix ENV key
sunxd3 Mar 25, 2024
99712ec
Update test/runtests.jl
sunxd3 Mar 25, 2024
11a60d8
fix more errors
sunxd3 Mar 25, 2024
f057c2e
fix more errors
sunxd3 Mar 25, 2024
837c6ff
Update test/graphs.jl
sunxd3 Mar 25, 2024
8f22695
fix path error
sunxd3 Mar 25, 2024
6edb153
fix file path
sunxd3 Mar 25, 2024
3468be4
fix folder name typo
sunxd3 Mar 25, 2024
e2520f7
fix more errors
sunxd3 Mar 25, 2024
20b083f
output profile result to step summary
sunxd3 Mar 26, 2024
224d3a6
remove CACHE_NAME from env
sunxd3 Mar 26, 2024
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
59 changes: 0 additions & 59 deletions .github/workflows/Benchmark.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CompatHelper
on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Check if Julia is already available in the PATH
id: julia_in_path
run: which julia
continue-on-error: true
- name: Install Julia, but only if it is not already available in the PATH
uses: julia-actions/setup-julia@v1
with:
version: '1'
arch: ${{ runner.arch }}
if: steps.julia_in_path.outcome != 'success'
- name: "Add the General registry via Git"
run: |
import Pkg
ENV["JULIA_PKG_SERVER"] = ""
Pkg.Registry.add("General")
shell: julia --color=yes {0}
- name: "Install CompatHelper"
run: |
import Pkg
name = "CompatHelper"
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
version = "3"
Pkg.add(; name, uuid, version)
shell: julia --color=yes {0}
- name: "Run CompatHelper"
run: |
import CompatHelper
CompatHelper.main()
shell: julia --color=yes {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
# COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}
58 changes: 34 additions & 24 deletions .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,65 @@
name: CI
name: Tests

on:
push:
branches:
- master
branches: ["master"]
pull_request:

workflow_dispatch:

jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
name: Julia ${{ matrix.version }} on ${{ matrix.os }} (${{ matrix.arch }})
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.version == 'nightly' }}
strategy:
fail-fast: false
matrix:
version:
- '1'
- '1.9'
- 'nightly'
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
version: ['1', '1.9', 'nightly']
os: [ubuntu-latest, macOS-latest, windows-latest]
arch: [x64]
test_group:
- 'profile'
- 'unit'
- 'parser'
- 'analysis_passes'
- 'compile_BUGS_examples'
- 'corner_cases'
- 'graph'
- 'gibbs'
- 'mcmchains'
# specific config for codecov
include:
- version: '1'
os: ubuntu-latest
arch: x64
coverage: true
env:
CACHE_NAME: julia-${{ matrix.version }}-${{ matrix.arch }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
- name: Cache Julia packages and artifacts
uses: actions/cache@v4
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
path: |
~/.julia
~/.julia/artifacts
key: ${{ runner.os }}-${{ env.CACHE_NAME }}-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
${{ runner.os }}-${{ env.CACHE_NAME }}-
${{ runner.os }}-julia-${{ matrix.version }}-
${{ runner.os }}-julia-
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
env:
TEST_GROUP: ${{ matrix.test_group }}
- uses: julia-actions/julia-processcoverage@v1
if: matrix.coverage
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v4
if: matrix.coverage
with:
file: lcov.info
Expand Down
52 changes: 26 additions & 26 deletions src/BUGSExamples/BUGSExamples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,38 @@ module BUGSExamples

using JuliaBUGS: @bugs

include("Volume_I/Blocker.jl")
include("Volume_I/Bones.jl")
include("Volume_I/Dogs.jl")
include("Volume_I/Dyes.jl")
include("Volume_I/Epil.jl")
include("Volume_I/Equiv.jl")
include("Volume_I/Inhalers.jl")
include("Volume_I/Kidney.jl")
include("Volume_I/Leuk.jl")
include("Volume_I/LeukFr.jl")
include("Volume_I/LSAT.jl")
include("Volume_I/Magnesium.jl")
include("Volume_I/Mice.jl")
include("Volume_I/Oxford.jl")
include("Volume_I/Pumps.jl")
include("Volume_I/Rats.jl")
include("Volume_I/Salm.jl")
include("Volume_I/Seeds.jl")
include("Volume_I/Stacks.jl")
include("Volume_I/Surgical.jl")
include("Volume_1/Blocker.jl")
include("Volume_1/Bones.jl")
include("Volume_1/Dogs.jl")
include("Volume_1/Dyes.jl")
include("Volume_1/Epil.jl")
include("Volume_1/Equiv.jl")
include("Volume_1/Inhalers.jl")
include("Volume_1/Kidney.jl")
include("Volume_1/Leuk.jl")
include("Volume_1/LeukFr.jl")
include("Volume_1/LSAT.jl")
include("Volume_1/Magnesium.jl")
include("Volume_1/Mice.jl")
include("Volume_1/Oxford.jl")
include("Volume_1/Pumps.jl")
include("Volume_1/Rats.jl")
include("Volume_1/Salm.jl")
include("Volume_1/Seeds.jl")
include("Volume_1/Stacks.jl")
include("Volume_1/Surgical.jl")

include("Volume_II/BiRats.jl")
include("Volume_II/Eyes.jl")
include("Volume_2/BiRats.jl")
include("Volume_2/Eyes.jl")

const VOLUME_I = (
const VOLUME_1 = (
blockers=blockers,
bones=bones,
dogs=dogs,
dyes=dyes,
epil=epil,
equiv=equiv,
inhalers=inhalers,
# inhalers=inhalers,
kidney=kidney,
leuk=leuk,
leukfr=leukfr,
Expand All @@ -50,10 +50,10 @@ const VOLUME_I = (
surgical_realistic=surgical_realistic,
)

const VOLUME_II = (birats=birats, eyes=eyes)
const VOLUME_2 = (birats=birats, eyes=eyes)

function has_ground_truth(m::Symbol)
if m in union(keys(VOLUME_I), keys(VOLUME_II))
if m in union(keys(VOLUME_1), keys(VOLUME_2))
return haskey(getfield(BUGSExamples, m), :reference_results)
else
return false
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/compiler_pass.jl
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ The function returns three values:
Array elements and array variables are represented by tuples in the returned value. All `Colon` indexing is assumed to be concretized.

# Examples
```jldoctest
```jldoctest; setup = :(using JuliaBUGS: evaluate_and_track_dependencies)
julia> evaluate_and_track_dependencies(:(x[a]), (x=[missing, missing], a = missing))
(missing, (:a, (:x, 1:2)))

Expand Down
8 changes: 4 additions & 4 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ end
Extract all the array variable names and number of dimensions from a given simple expression.

# Examples:
```jldoctest
```jldoctest; setup = :(using JuliaBUGS: extract_variable_names_and_numdims)
julia> extract_variable_names_and_numdims(:((a + b) * c), ())
(a = 0, b = 0, c = 0)

Expand Down Expand Up @@ -154,7 +154,7 @@ will raise an error.

# Example:
```jldoctest
extract_variable_names_and_numdims(
JuliaBUGS.extract_variable_names_and_numdims(
@bugs begin
for i in 1:N
for j in 1:T
Expand Down Expand Up @@ -434,7 +434,7 @@ Replace all `Colon()`s in `expr` with the corresponding array size.

# Examples
```jldoctest
julia> concretize_colon_indexing(:(f(x[1, :])), (x = [1 2 3 4; 5 6 7 8; 9 10 11 12],))
julia> JuliaBUGS.concretize_colon_indexing(:(f(x[1, :])), (x = [1 2 3 4; 5 6 7 8; 9 10 11 12],))
:(f(x[1, 1:4]))
```
"""
Expand All @@ -460,7 +460,7 @@ This function evaluates expressions that consist solely of arithmetic operations
is specifically designed for scenarios such as calculating array indices or determining loop boundaries.

# Example:
```jldoctest
```jldoctest; setup = :(using JuliaBUGS: simple_arithmetic_eval)
julia> simple_arithmetic_eval((a = 1, b = [1, 2]), 1)
1

Expand Down
48 changes: 0 additions & 48 deletions test/gradient_tests/blockers.csv

This file was deleted.

Loading
Loading