WIP: separate image testing workflow using the testing playground #64
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
# 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: | ||
pull_request: | ||
jobs: | ||
test: | ||
if: github.repository != 'ersilia-os/eos-template' | ||
runs-on: ubuntu-latest | ||
steps: | ||
# 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 | ||
with: | ||
# this might remove tools that are actually needed, | ||
# if set to "true" but frees about 6 GB | ||
tool-cache: true | ||
# all of these default to true, but feel free to set to | ||
# "false" if necessary for your workflow | ||
android: true | ||
dotnet: true | ||
haskell: true | ||
large-packages: true | ||
swap-storage: true | ||
- 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: | | ||
conda install git-lfs -c conda-forge | ||
git-lfs install | ||
conda install gh -c conda-forge | ||
python -m pip install 'ersilia[test]' | ||
# 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 }} | ||
run: | | ||
ersilia -v test $MODEL_ID -d . --inspect -l deep > test.log | ||
# Remove mock.txt if it exists | ||
- name: Cleanup | ||
run: | | ||
if [ -f "mock.txt" ]; then | ||
echo "Removing mock.txt file" | ||
rm "mock.txt" | ||
else | ||
echo "mock.txt not found, skipping removal" | ||
fi | ||
# Upload EOS logs and test logs | ||
- name: Upload log output | ||
if: always() | ||
uses: actions/[email protected] | ||
with: | ||
name: debug-logs | ||
retention-days: 14 | ||
path: | | ||
/home/runner/eos/*.log | ||
./*.log |