|
| 1 | +# run-pr-tests.yml |
| 2 | +# ----------------------------------------------------------------------------- |
| 3 | +# Run the unit/sim tests when a person is making a pull-request or pushing |
| 4 | +# directly to the repository. These "sim" tests that actually run EMOD will |
| 5 | +# use the Container Platform so that they do not need to access Foundation |
| 6 | +# assets (i.e. COMPS). |
| 7 | +# ----------------------------------------------------------------------------- |
| 8 | + |
| 9 | + |
| 10 | +name: "run_pr_tests" |
| 11 | +on: [push, pull_request] |
| 12 | +jobs: |
| 13 | + run-pr-tests: |
| 14 | + runs-on: ${{ matrix.os }} |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + os: [ubuntu-latest, windows-latest] |
| 18 | + python-version: [3.9] |
| 19 | + steps: |
| 20 | + - name: Check out Git repository |
| 21 | + uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - name: ${{ matrix.os }} Python ${{ matrix.python-version }} |
| 24 | + uses: actions/setup-python@v5 |
| 25 | + with: |
| 26 | + python-version: ${{ matrix.python-version }} |
| 27 | + architecture: x64 |
| 28 | + |
| 29 | + - name: Install Python dependencies |
| 30 | + run: | |
| 31 | + python -m pip install --upgrade pip |
| 32 | + python -m pip install --upgrade py-make flake8 black |
| 33 | +
|
| 34 | + - name: Install code |
| 35 | + run: | |
| 36 | + python -m pip install --upgrade -e . --extra-index-url=https://packages.idmod.org/api/pypi/pypi-production/simple |
| 37 | +
|
| 38 | + - name: install test packages |
| 39 | + run: | |
| 40 | + python -m pip install --upgrade -r tests/requirements.txt |
| 41 | +
|
| 42 | + - name: run tests |
| 43 | + run: | |
| 44 | + cd tests |
| 45 | + pytest test_download_from_package.py |
| 46 | + pytest --dist loadfile -v -m emod --junitxml="test_results.xml" |
| 47 | +
|
| 48 | + - name: Upload emodpy test results |
| 49 | + uses: actions/upload-artifact@v4 |
| 50 | + if: failure() |
| 51 | + with: |
| 52 | + name: emodpy_test_results |
| 53 | + path: tests/test_results.xml |
0 commit comments