Skip to content

Commit e196cea

Browse files
committed
ci: Add tests for mesa-examples
1 parent 1d48db5 commit e196cea

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/build_lint.yml

+33
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,36 @@ jobs:
7777
- if: matrix.os == 'ubuntu'
7878
name: Codecov
7979
uses: codecov/codecov-action@v3
80+
81+
test_examples:
82+
runs-on: ubuntu-latest
83+
- uses: actions/checkout@v4
84+
- name: Set up Python
85+
uses: actions/setup-python@v5
86+
with:
87+
python-version: "3.12"
88+
- uses: actions/cache@v3
89+
with:
90+
path: ${{ env.pythonLocation }}
91+
key: test-examples-pip-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}
92+
- name: Install dependencies
93+
# Only if the cache misses
94+
# Based on https://github.com/pypa/pip/issues/8049#issuecomment-633845028
95+
# read_requirements.py should be removed once
96+
# https://github.com/pypa/pip/issues/11440 is resolved.
97+
if: steps.cache.outputs.cache-hit != 'true'
98+
run: |
99+
pip install toml
100+
python tests/read_requirements.py > requirements.txt
101+
pip install -r requirements.txt
102+
- name: Install Mesa
103+
run: pip install --no-deps .
104+
- name: Checkout mesa-examples
105+
uses: actions/checkout@v4
106+
with:
107+
repository: projectmesa/mesa-examples
108+
path: mesa-examples
109+
- name: Test examples
110+
run: |
111+
cd mesa-examples
112+
pytest test_examples.py

0 commit comments

Comments
 (0)