Skip to content

Commit 7a9e6d0

Browse files
Create test-model-image-debug.yml
1 parent 0f576f6 commit 7a9e6d0

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Test model image debug
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
repo_name:
7+
required: true
8+
type: string
9+
secrets:
10+
DOCKERHUB_USERNAME:
11+
required: true
12+
DOCKERHUB_PASSWORD:
13+
required: true
14+
15+
jobs:
16+
test-image-arm64:
17+
runs-on: default-linux-arm64
18+
steps:
19+
- name: print architecture
20+
run: |
21+
echo "Architecture: $(uname -m)"
22+
- name: Set up conda
23+
uses: conda-incubator/setup-miniconda@v3
24+
with:
25+
auto-update-conda: true
26+
python-version: "3.12"
27+
auto-activate-base: false
28+
29+
- name: Debug Conda environments
30+
run: |
31+
conda info
32+
conda env list
33+
34+
- name: Install dependencies
35+
run: |
36+
conda run -n base python -m pip install 'git+https://github.com/ersilia-os/ersilia.git#egg=ersilia[test]'
37+
conda run -n base ersilia --version
38+
39+
- name: Test ARM64 image
40+
env:
41+
MODEL_ID: ${{ inputs.repo_name }}
42+
run: |
43+
source ~/miniconda3/etc/profile.d/conda.sh
44+
conda activate base
45+
ersilia -v test $MODEL_ID --deep --from_dockerhub --version dev-arm64
46+
47+
- name: Parse test results
48+
env:
49+
MODEL_ID: ${{ inputs.repo_name }}
50+
run: |
51+
TEST_JSON="${MODEL_ID}-test.json"
52+
53+
if [[ ! -f "$TEST_JSON" ]]; then
54+
echo "Error: Test results file $TEST_JSON not found!"
55+
exit 1
56+
fi
57+
mv "${MODEL_ID}-test.json" "${MODEL_ID}-test-arm64.json"
58+
TEST_JSON="${MODEL_ID}-test-arm64.json"
59+
echo "Parsing test results from $TEST_JSON"
60+
61+
TEST_FAILED=$(jq 'recurse | objects | select(map(select(. == false)) | length > 0)' "$TEST_JSON")
62+
if [[ -n "$TEST_FAILED" ]]; then
63+
echo "❌ Some tests failed. Stopping workflow."
64+
exit 1
65+
fi

0 commit comments

Comments
 (0)