forked from chstan/arpes
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from FAIRmat-NFDI/fix-tests
Updats ci and fixes momentum tests
- Loading branch information
Showing
7 changed files
with
206 additions
and
406 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,37 @@ | ||
name: Run Tests | ||
name: pytest | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
branches: [master] | ||
pull_request: | ||
branches: "**" | ||
branches: [master] | ||
|
||
jobs: | ||
test: | ||
pytest: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
QT_QPA_PLATFORM: offscreen | ||
strategy: | ||
max-parallel: 5 | ||
fail-fast: false | ||
matrix: | ||
python_version: ["3.8", "3.9", "3.10", "3.11"] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
- uses: actions/checkout@v3 | ||
with: | ||
python-version: "3.8" | ||
|
||
- name: Add conda to system path | ||
run: | | ||
# $CONDA is an environment variable pointing to the root of the miniconda directory | ||
echo $CONDA/bin >> $GITHUB_PATH | ||
- name: Get pip cache dir | ||
id: pip-cache | ||
run: | | ||
echo "::set-output name=dir::$(pip cache dir)" | ||
- name: Get conda package dir | ||
id: conda-cache | ||
run: | | ||
echo "::set-output name=dir::$(conda info --json | python -c "import sys, json; print(json.load(sys.stdin)['pkgs_dirs'][0])")" | ||
- name: Cache conda and PyPI modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-conda-and-pypi | ||
fetch-depth: 0 | ||
submodules: recursive | ||
- name: Set up Python ${{ matrix.python_version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
path: | | ||
${{ steps.pip-cache.outputs.dir }} | ||
${{ steps.conda-cache.outputs.dir }} | ||
key: ${{ runner.os }}-build-${{ env.cache-name}}-${{ hashFiles('**/environment*.yml') }} | ||
restore-keys: | | ||
${{ runner.os }}-conda | ||
python-version: ${{ matrix.python_version }} | ||
- name: Install dependencies | ||
run: | | ||
conda env create --quiet --file environment.yml | ||
- name: Source environment, test with pytest and generate coverage | ||
python -m pip install --upgrade pip | ||
- name: Install package | ||
run: | | ||
source activate arpes | ||
conda env update --file environment-update-test.yml | ||
sudo apt install libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 | ||
echo "Installed dependencies as below" | ||
pip freeze | ||
echo "Now running tests" | ||
python -m pytest -c pytest-config/pytest-coverage-codecov.ini | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./coverage.xml | ||
flags: unittests | ||
env_vars: OS,PYTHON | ||
fail_ci_if_error: true | ||
path_to_write_report: ./coverage/codecov_report.txt | ||
verbose: true | ||
pip install -e ".[core, test]" | ||
pip install pytest pytest-qt | ||
- name: Test with pytest | ||
run: | | ||
pytest -sv --show-capture=no tests |
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 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
Oops, something went wrong.