-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Conda envs in all CI jobs (#368)
## Description <!-- Provide a brief description of the PR's purpose here. --> We encountered an issue in #366 where different Python instances caused swig to not be found. To prevent this and similar issues in the future, this PR creates Conda envs to ensure that we always / are more likely to use the correct version of Python. ## TODO <!-- Notable points that this PR has either accomplished or will accomplish. --> ## Questions <!-- Any concerns or points of confusion? --> - [x] Should we use Tox? - For now, I believe Tox would introduce too much complexity. All we want is to create a virtual env for each job. Tox may be able to do this with less boilerplate, but we would also incur overhead to learn how to use it properly. Conda envs also more closely match our audience of researchers. - Note that we did have Tox originally, but we removed it in #143 to simplify our workflows. ## Status - [x] I have read the guidelines in [CONTRIBUTING.md](https://github.com/icaros-usc/pyribs/blob/master/CONTRIBUTING.md) - [x] I have formatted my code using `yapf` - [x] I have tested my code by running `pytest` - [x] I have linted my code with `pylint` - [x] I have added a one-line description of my change to the changelog in `HISTORY.md` - [x] This PR is ready to go
- Loading branch information
Showing
2 changed files
with
17 additions
and
32 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -10,6 +10,13 @@ on: | |
branches: | ||
- master | ||
|
||
defaults: | ||
run: | ||
# The default shell must be set like this so that bash will source the | ||
# profile, which contains settings initialized by Conda: | ||
# https://github.com/marketplace/actions/setup-miniconda#important | ||
shell: bash -el {0} | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
|
@@ -19,9 +26,9 @@ jobs: | |
SKIP: pylint | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
python-version: 3.11 | ||
python-version: "3.11" | ||
- name: Install all deps and pylint (to be available to pre-commit) | ||
run: pip install .[all] pylint | ||
- uses: pre-commit/[email protected] | ||
|
@@ -42,12 +49,9 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Upgrade pip | ||
run: python -m pip install --upgrade pip | ||
- name: Install core deps | ||
run: pip install .[dev] | ||
- name: Test core | ||
|
@@ -57,12 +61,9 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v4 | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
python-version: "3.8" | ||
- name: Upgrade pip | ||
run: python -m pip install --upgrade pip | ||
- name: Install core deps | ||
run: pip install -r pinned_reqs/install.txt .[dev] | ||
- name: Test core | ||
|
@@ -80,12 +81,9 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v4 | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
python-version: "3.8" | ||
- name: Upgrade pip | ||
run: python -m pip install --upgrade pip | ||
- name: Install deps | ||
run: pip install .[visualize,dev] | ||
- name: Test coverage | ||
|
@@ -100,12 +98,9 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v4 | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
python-version: "3.8" | ||
- name: Upgrade pip | ||
run: python -m pip install --upgrade pip | ||
- name: Install deps | ||
run: pip install .[visualize,dev] | ||
- name: Run benchmarks | ||
|
@@ -122,10 +117,8 @@ jobs: | |
with: | ||
python-version: 3.8 | ||
- name: Install deps | ||
shell: bash -el {0} | ||
run: pip install .[visualize] | ||
- name: Test Examples | ||
shell: bash -el {0} | ||
run: bash tests/examples.sh | ||
tutorials: | ||
runs-on: ubuntu-latest | ||
|
@@ -136,12 +129,9 @@ jobs: | |
run: sudo apt-get remove swig | ||
# We use Python 3.10 instead of 3.8 here since Google Colab uses 3.10. | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
python-version: "3.10" | ||
- name: Upgrade pip | ||
run: python -m pip install --upgrade pip | ||
- name: Install deps | ||
run: pip install .[visualize] jupyter nbconvert | ||
- name: Test Tutorials | ||
|
@@ -150,12 +140,9 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v4 | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
python-version: "3.8" | ||
- name: Upgrade pip | ||
run: python -m pip install --upgrade pip | ||
- name: Install deps | ||
run: pip install .[visualize,dev] | ||
- name: Build docs | ||
|
@@ -166,12 +153,9 @@ jobs: | |
if: startsWith(github.ref, 'refs/tags') | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v4 | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
python-version: "3.8" | ||
- name: Upgrade pip | ||
run: python -m pip install --upgrade pip | ||
- name: Install dependencies | ||
run: | | ||
pip install -e . | ||
|
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