Skip to content

Commit 151436e

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

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/build_lint.yml

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

0 commit comments

Comments
 (0)