Skip to content

Commit

Permalink
MNT: housekeeping for build-test.yaml GHA workflow (better job names,…
Browse files Browse the repository at this point in the history
… update actions, merge with pytest-specific duplicate workflow)
  • Loading branch information
neutrinoceros committed May 22, 2022
1 parent 1e71c23 commit c341fa3
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 88 deletions.
63 changes: 0 additions & 63 deletions .github/workflows/build-test-pytest.yaml

This file was deleted.

51 changes: 40 additions & 11 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ on:
pull_request:
paths-ignore:
- "doc/**"
- README.md
- "**/*.md"
- .pre-commit-config.yaml
workflow_dispatch:

defaults:
run:
Expand All @@ -19,37 +21,58 @@ env:
jobs:

build:
name: "${{ matrix.tests-type }} tests: py${{ matrix.python-version }} on ${{ matrix.os }} (${{ matrix.test-runner }})"
strategy:
matrix:
os: [
macos-latest,
windows-latest,
ubuntu-latest,
]
python-version: [3.9]
python-version: ['3.10']
dependencies: [full]
tests-type: [unit]
test-runner: [pytest]
include:
- os: ubuntu-latest
python-version: 3.7
python-version: '3.7'
dependencies: minimal
tests-type: unit
test-runner: pytest
- os: ubuntu-latest
python-version: 3.7
# this job is necessary for non-answer, 'yield' based tests
# because pytest doesn't support such tests, and nose is not
# compatible with Python 3.10
python-version: '3.9'
dependencies: full
tests-type: unit
test-runner: nose
- os: ubuntu-latest
# answer tests use 'yield', so they require nose
# they are also attached to a specific, occasionally updated, Python version
# but it does *not* have to match the current minimal supported version
python-version: '3.7'
dependencies: full
tests-type: answer
test-runner: nose

runs-on: ${{ matrix.os }}

steps:
- name: Install Python
uses: actions/setup-python@v2
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v2
- name: Checkout repo (bare)
if: matrix.tests-type != 'answer'
uses: actions/checkout@v3
- name: Checkout repo (with submodules)
if: matrix.tests-type == 'answer'
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- uses: s-weigand/setup-conda@v1
submodules: true
- name: Set up Conda (windows only)
uses: s-weigand/setup-conda@v1
if: matrix.os == 'windows-latest'
with:
update-conda: true
Expand All @@ -61,7 +84,13 @@ jobs:
env:
dependencies: ${{ matrix.dependencies }}
run: source ./tests/ci_install.sh
- name: Run Tests
- name: Run Tests (pytest)
if: matrix.test-runner == 'pytest'
env:
testsuite: ${{ matrix.tests-type }}
run: pytest
- name: Run Tests (nose)
if: matrix.test-runner == 'nose'
env:
testsuite: ${{ matrix.tests-type }}
run: python -m nose -c nose_${testsuite}.cfg --traverse-namespace
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[![Sponsor our Project](https://img.shields.io/badge/donate-to%20yt-blueviolet)](https://numfocus.salsalabs.org/donate-to-yt/index.html)

<!--- Tests and style --->
![Build and Test](https://github.com/yt-project/yt/workflows/Build%20and%20Test/badge.svg?branch=main)
[![Build and Test](https://github.com/yt-project/yt/actions/workflows/build-test.yaml/badge.svg)](https://github.com/yt-project/yt/actions/workflows/build-test.yaml)
[![CI (bleeding edge)](https://github.com/yt-project/yt/actions/workflows/bleeding-edge.yaml/badge.svg)](https://github.com/yt-project/yt/actions/workflows/bleeding-edge.yaml)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/yt-project/yt/main.svg)](https://results.pre-commit.ci/latest/github/yt-project/yt/main)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
Expand Down
16 changes: 3 additions & 13 deletions tests/ci_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,15 @@ if [[ "${RUNNER_OS}" == "Windows" ]] && [[ ${dependencies} != "minimal" ]]; then
# keep in sync: setup.cfg
while read requirement; do conda install --yes $requirement; done < tests/windows_conda_requirements.txt
else
python -m pip install --upgrade "pip != 22.1"
python -m pip install --upgrade pip
python -m pip install --upgrade wheel

# // band aid
# TODO: revert https://github.com/yt-project/yt/pull/3733
# when the following upstream PR is released
# https://github.com/mpi4py/mpi4py/issues/160

# workaround taken from
# https://github.com/mpi4py/mpi4py/issues/157#issuecomment-1001022274
export SETUPTOOLS_USE_DISTUTILS=stdlib
python -m pip install mpi4py
# // end band aid

python -m pip install --upgrade setuptools
fi

# Step 2: install deps and yt
if [[ ${dependencies} == "minimal" ]]; then
# installing in editable mode so this script may be used locally by developers
# but the primary intention is to embed this script in CI jobs
python -m pip install -e .[test,minimal]
else
# Cython and numpy are build-time requirements to the following optional deps in yt
Expand Down

0 comments on commit c341fa3

Please sign in to comment.