-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
17 changed files
with
590 additions
and
175 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 |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request | ||
pull_request: | ||
branches: | ||
- master | ||
# disabled because of https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ | ||
# pull_request_target: | ||
# branches: | ||
# - master | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: true | ||
|
||
matrix: | ||
python-version: [ | ||
# "3.8", | ||
"3.9", | ||
# "3.10", | ||
# "3.11" | ||
] | ||
django-version: [ | ||
"3.2", | ||
# "4.0", | ||
# "4.1", | ||
# "4.2", | ||
] | ||
es-dsl-version: [ | ||
"6.1", | ||
# "6.2", | ||
"6.4", | ||
# "7.4" | ||
] | ||
# the version of elasticsearch server to run, not the version of elasticsearch-py to install | ||
es-version: [ | ||
"6.8.2", | ||
# failing - https://github.com/HBS-HBX/django-elastic-migrations/actions/runs/5468957506/jobs/9957279973?pr=91 | ||
# "7.13.4", | ||
] | ||
|
||
|
||
# exclude: | ||
# - python-version: "3.9" | ||
# django-version: "1.11" | ||
|
||
steps: | ||
- name: Install and Run Elasticsearch | ||
uses: elastic/elastic-github-actions/elasticsearch@master | ||
with: | ||
stack-version: ${{ matrix.es-version }} | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Install Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Cache Pip Dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/test.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install "Django==${{ matrix.django-version }}" | ||
python -m pip install "elasticsearch-dsl==${{ matrix.es-dsl-version }}" | ||
python -m pip install -r requirements/test.txt | ||
- name: Run tests with Python ${{ matrix.python-version }} and Django ${{ matrix.django-version }} and elasticsearch-dsl-py ${{ matrix.es-dsl-version }} | ||
run: | | ||
TOX_ENV=$(echo "py${{ matrix.python-version }}-django-${{ matrix.django-version }}-es${{ matrix.es-dsl-version }}" | tr -d .) | ||
echo -e "TOX_ENV: $TOX_ENV" | ||
python -m tox -e $TOX_ENV | ||
# | ||
# - name: Publish Coverage Report | ||
# uses: codecov/codecov-action@v1 |
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
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,26 @@ | ||
# Running Tests | ||
|
||
## Running Tests Locally with one version of python on mac | ||
|
||
### install postgres - [deprecated / optional for now] | ||
* _This is deprecated because for now we are using sqlite for testing_ | ||
* _In time, we may add this back_ | ||
* we need `pg_config` to be installed in order to use python locally | ||
* `brew install postgresql` | ||
* you may need to do `brew tap homebrew/core` first | ||
|
||
### install version(s) of python you want to test with | ||
* install pyenv | ||
* use it to install python 3.9 and 3.10, or the versions you care about | ||
* `pyenv local 3.9.17 3.10.11` or whatever versions you want | ||
|
||
### install pip deps | ||
* `make requirements` to install pip deps | ||
* note that this requires `pg_config` to be on PATH | ||
|
||
### run tests | ||
* in another terminal, bring up dockerized postgres: `docker compose up` | ||
* `make test` to run tests | ||
|
||
## Running Tests Locally with multiple versions of python on mac | ||
|
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.