IfDM to EMOD-Hub from Bridenbecker Repo #12
Workflow file for this run
This file contains hidden or 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
| # run-comps-tests.yml | |
| # ----------------------------------------------------------------------------- | |
| # Run the unit/sim tests when a person is making a pull-request or pushing | |
| # directly to the repository. These "sim" tests that actually run EMOD will | |
| # use the COMPS so that they need to access Foundation assets. This requires | |
| # the GitHub secrets so the branch must be in the pull request must be part of | |
| # the EMOD-Hub repo. | |
| # ----------------------------------------------------------------------------- | |
| name: "run_comps_tests" | |
| on: [push, pull_request] | |
| jobs: | |
| run-comps-tests: | |
| runs-on: ${{ matrix.os }} | |
| if: "contains(github.event.pull_request.head.repo.full_name, 'EMOD-Hub/emodpy')" | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| python-version: [3.9] | |
| steps: | |
| - name: Check out Git repository | |
| uses: actions/checkout@v4 | |
| - name: ${{ matrix.os }} Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| architecture: x64 | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install --upgrade py-make flake8 black | |
| - name: Install code | |
| run: | | |
| python -m pip install --upgrade -e . --extra-index-url=https://packages.idmod.org/api/pypi/pypi-production/simple | |
| - name: install test packages | |
| run: | | |
| python -m pip install --upgrade -r tests/requirements.txt | |
| - name: login to comps2 | |
| run: | | |
| python .dev_scripts/create_auth_token_args.py --username ${{ secrets.COMPS_USER }} --password ${{ secrets.COMPS_PASSWORD }} | |
| env: | |
| COMPS_USER: ${{ secrets.COMPS_USER }} | |
| COMPS_PASSWORD: ${{ secrets.COMPS_PASSWORD }} | |
| - name: run tests | |
| run: | | |
| cd tests | |
| pytest test_download_from_package.py | |
| pytest -n 10 --dist loadfile -v -m comps --junitxml="test_results.xml" | |
| - name: Upload emodpy test results | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: emodpy_test_results | |
| path: tests/test_results.xml |