-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: update test-model-pr workflow to only use ersilia test command
- Loading branch information
1 parent
aaabd61
commit 86ffec5
Showing
1 changed file
with
22 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# This workflow only tests the model on PRs, not on every push to the main branch. | ||
# TODO(@dhanshree): Test ersilia in all supported Python versions | ||
name: Model Test on PR | ||
|
||
on: | ||
|
@@ -8,10 +10,6 @@ jobs: | |
if: github.repository != 'ersilia-os/eos-template' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # [email protected] | ||
with: | ||
lfs: true | ||
|
||
# This might stop working in the future, so we need to keep an eye on it | ||
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/free-disk-space@main | ||
|
@@ -28,51 +26,31 @@ jobs: | |
large-packages: true | ||
swap-storage: true | ||
|
||
- name: Add conda to system path | ||
run: echo $CONDA/bin >> $GITHUB_PATH | ||
|
||
- name: Source conda | ||
run: source $CONDA/etc/profile.d/conda.sh | ||
|
||
- name: Set Python to 3.10.10 | ||
run: conda install -y python=3.10.10 | ||
- uses: actions/[email protected] | ||
with: | ||
lfs: true | ||
- uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
auto-update-conda: true | ||
python-version: "3.10.10" | ||
|
||
- name: Install dependencies | ||
run: | | ||
source activate | ||
conda init | ||
conda install git-lfs -c conda-forge | ||
git-lfs install | ||
conda install gh -c conda-forge | ||
python -m pip install 'ersilia[test]' | ||
- name: Install ersilia | ||
run: | | ||
source activate | ||
python --version | ||
echo "After conda init" | ||
conda init | ||
python -m pip install git+https://github.com/ersilia-os/ersilia.git | ||
- name: Predict output | ||
# TODO(@dhanshree) We can potentially restore the retries. | ||
# TODO(@dhanshree) Correct the test command as needed | ||
- name: Test model | ||
env: | ||
MODEL_ID: ${{ github.event.repository.name }} | ||
uses: nick-fields/retry@v3 | ||
with: | ||
timeout_minutes: 10 | ||
max_attempts: 3 | ||
command: | | ||
source activate | ||
echo "Sample model id selected: $MODEL_ID" | ||
ersilia -v fetch $MODEL_ID --from_dir . | ||
ersilia -v serve $MODEL_ID | ||
ersilia example -n 5 -f input.csv --predefined | ||
ersilia -v run -i input.csv | ||
ersilia close | ||
echo "Perform detail check on model: $MODEL_ID" | ||
ersilia -v test $MODEL_ID -d . --inspect -l deep | ||
run: | | ||
ersilia -v test $MODEL_ID -d . --inspect -l deep > test.log | ||
- name: Remove mock.txt if it exists | ||
# Remove mock.txt if it exists | ||
- name: Cleanup | ||
run: | | ||
if [ -f "mock.txt" ]; then | ||
echo "Removing mock.txt file" | ||
|
@@ -81,10 +59,13 @@ jobs: | |
echo "mock.txt not found, skipping removal" | ||
fi | ||
# Upload EOS logs and test logs | ||
- name: Upload log output | ||
if: always() | ||
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb #pin v3.1.1 | ||
uses: actions/upload-artifact@v4.5.0 | ||
with: | ||
name: debug-logs | ||
retention-days: 14 | ||
path: /home/runner/eos/*.log | ||
path: | | ||
/home/runner/eos/*.log | ||
./*.log |