-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add multiple python versions to CI tests (#858)
* Add multiple python versions to CI tests * Remove duplicate key * Combine CI jobs * Update ubuntu image and actually install Python versions * Replace pyenv with apt-get to install python versions * Remove sudo * Remove get from 'apt-get' * Update apt before attempting to install * Add ppa/deadsnakes repository * Add prereq * Fix typo * Add -y to install command * Move -y to correct spot * Add more -ys * Add some echoes to debug * Switch back to pyenv approach * Remove tests from circleci config and move to new github actions config Note: no caching yet, this is more of a proof of concept * Split out Mac tests into seaparate file * Set testing environmental variable separately * First attempt to add depdendency cache * Remove windows tests for now * Fix circleci config * Fix circleci for real this time * Add tests on merging of PRs and update readme to show we do not support for Python 3.7
- Loading branch information
Showing
4 changed files
with
99 additions
and
48 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
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: tests | ||
|
||
on: | ||
pull_request: | ||
branches: ["main"] | ||
push: | ||
branches: ["main"] | ||
|
||
env: | ||
TESTING: 1 | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
python-version: ['3.8', '3.9', '3.10'] | ||
os: [ubuntu-latest] # add in windows-latest to add windows testing | ||
include: | ||
- os: ubuntu-latest | ||
path: ~/.cache/pip | ||
# - os: windows-latest | ||
# path: ~\AppData\Local\pip\Cache | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: ${{ matrix.path }} | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install dependencies | ||
run: python -m pip install -r requirements.txt | ||
|
||
- name: Run tests | ||
run: pytest -rf test/ | ||
|
||
- name: check linting | ||
run: | | ||
# E203 and W503 don't work well with black | ||
flake8 parsons/ test/ useful_resources/ --extend-ignore=E203,W503 | ||
black --check parsons/ test/ useful_resources/ |
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: tests for mac | ||
# test mac on single python version as mac tests use 10x minutes/storage | ||
|
||
on: | ||
pull_request: | ||
branches: ["main"] | ||
push: | ||
branches: ["main"] | ||
|
||
env: | ||
TESTING: 1 | ||
|
||
jobs: | ||
build: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: ~/Library/Caches/pip | ||
key: mac-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
mac-pip- | ||
- name: Install dependencies | ||
run: python -m pip install -r requirements.txt | ||
|
||
- name: Run tests | ||
run: TESTING=1 pytest -rf test/ | ||
|
||
- name: check linting | ||
run: | | ||
# E203 and W503 don't work well with black | ||
flake8 parsons/ test/ useful_resources/ --extend-ignore=E203,W503 | ||
black --check parsons/ test/ useful_resources/ |
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