-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use GitHub Actions for CI #776
Changes from all commits
15c3f4d
ed587b2
e5da565
8af97ce
ad0b34d
c1f3c47
09b734d
a8bc1d2
931ad29
79e488e
f21b2b3
0aa23eb
c6565da
6d9eb6c
a675a22
4ae33fe
1191c9d
6bbc6f0
46a1e34
8e0d131
abaf092
3234e46
bb37cc7
1f5578d
fefa48b
faff779
360b898
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Run Unit Tests | ||
|
||
on: | ||
# trigger on pull requests | ||
pull_request: | ||
|
||
# trigger on all commits to master | ||
push: | ||
branches: | ||
- 'master' | ||
bdice marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# trigger on request | ||
workflow_dispatch: | ||
concurrency: | ||
group: "${{ github.workflow }}-${{ github.ref }}" | ||
cancel-in-progress: true | ||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
config: [ {python: '3.8', dependencies: 'newest'}, | ||
{python: '3.9', dependencies: 'newest'}, | ||
{python: '3.10', dependencies: 'newest'}, | ||
{python: '3.10', dependencies: 'minimal'}, | ||
{python: '3.8', dependencies: 'oldest'} ] | ||
exclude: | ||
# macOS, Python 3.10 is excluded because zarr dependency numcodecs is | ||
# not yet available as a wheel for that configuration and fails to | ||
# build from source. See | ||
# https://github.com/zarr-developers/numcodecs/issues/326 | ||
- os: macos-latest | ||
config: {python: '3.10', dependencies: 'newest'} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.config.python }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.config.python }} | ||
- name: Install newest dependencies | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is a good idea but I'm going to leave it out-of-scope for this PR. Looks like this explains how to set it up for pip caching: https://github.com/actions/cache/blob/main/examples.md#simple-example There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Caching works fine on multi-platform CI. You include the platform and any other relevant system specific quantities (like python version) in the cache key. Your "install newest" dependencies step takes ~3 m 18 s (out of 10m 56 s total test time). Caching would remove the download times from that 3m 18s, but not the install times. |
||
run: | | ||
pip install -r requirements/requirements-test.txt | ||
pip install -r requirements/requirements-test-optional.txt | ||
if: ${{ matrix.config.dependencies == 'newest' }} | ||
- name: Install minimal dependencies | ||
run: | | ||
pip install -r requirements/requirements-test.txt | ||
if: ${{ matrix.config.dependencies == 'minimal' }} | ||
- name: Install oldest supported dependencies | ||
run: | | ||
pip install -r .circleci/ci-oldest-reqs.txt | ||
if: ${{ matrix.config.dependencies == 'oldest' }} | ||
- name: Install the package | ||
run: | | ||
pip install -e . | ||
- name: Run MongoDB | ||
uses: supercharge/mongodb-github-action@1.7.0 | ||
if: ${{ matrix.os == 'ubuntu-latest' && matrix.config.dependencies != 'minimal' }} | ||
- name: Run Redis | ||
uses: supercharge/redis-github-action@1.4.0 | ||
if: ${{ matrix.os == 'ubuntu-latest' && matrix.config.dependencies != 'minimal' }} | ||
- name: Test with pytest | ||
run: | | ||
pytest --cov=signac --cov-config=setup.cfg --cov-report=xml tests/ -v | ||
- uses: codecov/codecov-action@v2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want this to run on all PRs or ones that target a given branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All PRs? 🤷♂️