Skip to content

Commit 8d31950

Browse files
committed
added CI/CD
1 parent cf33962 commit 8d31950

5 files changed

Lines changed: 166 additions & 4 deletions

File tree

.github/workflows/CI-Nightly.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Nightly Latest Deps
2+
3+
on:
4+
schedule:
5+
- cron: '0 6 * * 1'
6+
workflow_dispatch:
7+
8+
jobs:
9+
10+
test-latest:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
workflow:
17+
- patient_level_prediction
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: julia-actions/setup-julia@v2
23+
with:
24+
version: '1'
25+
26+
- uses: julia-actions/cache@v2
27+
28+
- name: Instantiate and update
29+
run: |
30+
julia --project=src/workflows/${{ matrix.workflow }} -e '
31+
using Pkg
32+
Pkg.instantiate()
33+
Pkg.update()
34+
'
35+
36+
- name: Load packages
37+
run: |
38+
julia --project=src/workflows/${{ matrix.workflow }} -e '
39+
using Pkg
40+
for (_,pkg) in Pkg.dependencies()
41+
pkg.is_direct_dep || continue
42+
@eval using $(Symbol(pkg.name))
43+
println(pkg.name)
44+
end
45+
'
46+
47+
notify-failure:
48+
needs: test-latest
49+
if: failure()
50+
runs-on: ubuntu-latest
51+
52+
permissions:
53+
issues: write
54+
55+
steps:
56+
- uses: actions/github-script@v7
57+
with:
58+
script: |
59+
const title = `Nightly CI failure ${new Date().toISOString().slice(0,10)}`
60+
const body = `Nightly ecosystem integration test failed.\n\nRun: ${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`
61+
62+
const issues = await github.rest.issues.listForRepo({
63+
owner: context.repo.owner,
64+
repo: context.repo.repo,
65+
state: 'open'
66+
})
67+
68+
if (!issues.data.some(i => i.title.includes('Nightly CI failure'))) {
69+
await github.rest.issues.create({
70+
owner: context.repo.owner,
71+
repo: context.repo.repo,
72+
title,
73+
body,
74+
labels: ['ci-failure']
75+
})
76+
}

.github/workflows/CI.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ci-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
16+
test:
17+
name: Workflow Tests (${{ matrix.workflow }}, Julia ${{ matrix.julia-version }})
18+
runs-on: ubuntu-latest
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
julia-version: ['1.10', '1', 'pre']
24+
workflow:
25+
- patient_level_prediction
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- uses: julia-actions/setup-julia@v2
31+
with:
32+
version: ${{ matrix.julia-version }}
33+
34+
- uses: julia-actions/cache@v2
35+
36+
- name: Instantiate environment
37+
run: |
38+
julia --project=src/workflows/${{ matrix.workflow }} -e '
39+
using Pkg
40+
Pkg.instantiate()
41+
'
42+
43+
- name: Load dependencies
44+
run: |
45+
julia --project=src/workflows/${{ matrix.workflow }} -e '
46+
using Pkg
47+
for (_,pkg) in Pkg.dependencies()
48+
pkg.is_direct_dep || continue
49+
@eval using $(Symbol(pkg.name))
50+
println(pkg.name)
51+
end
52+
'

.github/workflows/CompatHelper.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: CompatHelper
2+
3+
on:
4+
schedule:
5+
- cron: '0 */6 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
10+
CompatHelper:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: julia-actions/setup-julia@v2
15+
with:
16+
version: '1'
17+
18+
- name: Run CompatHelper
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
22+
run: |
23+
julia -e '
24+
using Pkg
25+
Pkg.add("CompatHelper")
26+
using CompatHelper
27+
CompatHelper.main()
28+
'
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
# Julia artifacts
2-
Manifest.toml
1+
# Local runtime artifacts
2+
config.toml
3+
output/

src/workflows/patient_level_prediction/Project.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name = "Patient Level Prediction"
1+
name = "PatientLevelPrediction"
22
authors = ["kosuri-indu"]
33

44
[deps]
@@ -11,7 +11,6 @@ Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
1111
DuckDB = "d2f5444f-75bc-4fdf-ac35-56f514c445e1"
1212
FunSQL = "cf6cc811-59f4-4a10-b258-a8547a8f6407"
1313
InvertedIndices = "41ab1584-1d38-5bbf-9106-f11c6c58b48f"
14-
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
1514
LibPQ = "194296ae-ab2e-5f79-8cd4-7183a0a5a0d1"
1615
MLJBase = "a7f614a8-145f-11e9-1d2a-a57a1082229d"
1716
MLJDecisionTreeInterface = "c6f25543-311c-4c74-83dc-3ea6d1015661"
@@ -48,3 +47,9 @@ ROCAnalysis = "0.3.6"
4847
Tables = "1"
4948
XGBoost = "2.5.1"
5049
julia = "1.10"
50+
51+
[extras]
52+
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
53+
54+
[targets]
55+
dev = ["JuliaFormatter"]

0 commit comments

Comments
 (0)