Files
sqlalchemy/.github/workflows/run-test.yaml
T
Federico Caselli 8750eb6ef1 Add github action workflow to run tests on master and on pr to master
Trying the pr to check if it works right away

<!-- Describe your changes in detail -->

<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [ ] A documentation / typographical error fix
	- Good to go, no issue or tests are needed
- [x] A short code fix
	- please include the issue number, and create an issue if none exists, which
	  must include a complete example of the issue.  one line code fixes without an
	  issue and demonstration will not be accepted.
	- Please include: `Fixes: #<issue number>` in the commit message
	- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
	- please include the issue number, and create an issue if none exists, which must
	  include a complete example of how the feature would look.
	- Please include: `Fixes: #<issue number>` in the commit message
	- please include tests.

**Have a nice day!**

Closes: #5222
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5222
Pull-request-sha: afbb856752

Change-Id: I4981b02f900e76e446cf42e6cc6495ffc0883951
(cherry picked from commit c658540b9a)
2020-04-08 10:14:17 -04:00

83 lines
2.2 KiB
YAML

name: Run tests
on:
# run on push in master or rel_* branches excluding changes are only on doc or example folders
push:
branches:
- master
- "rel_*"
# branches used to test the workflow
- "workflow_test_*"
paths-ignore:
- "doc/**"
- "examples/**"
env:
# global env to all steps
TOX_WORKERS: -n2
jobs:
run-test:
name: ${{ matrix.python-version }}-${{ matrix.build-type }}-${{ matrix.architecture }}-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
# run this job using this matrix, excluding some combinations below.
matrix:
os:
- "ubuntu-latest"
- "windows-latest"
- "macos-latest"
python-version:
- "2.7"
- "3.5"
- "3.6"
- "3.7"
- "3.8"
build-type:
- "cext"
- "nocext"
architecture:
- x64
- x86
include:
# the mock reconnect test seems to fail on the ci in windows
- os: "windows-latest"
pytest-args: "-k 'not MockReconnectTest'"
exclude:
# c-extensions fail to build on windows for python 3.5 and 2.7
- os: "windows-latest"
python-version: "2.7"
build-type: "cext"
- os: "windows-latest"
python-version: "3.5"
build-type: "cext"
# linux and osx do not have x86 python
- os: "ubuntu-latest"
architecture: x86
- os: "macos-latest"
architecture: x86
# abort all jobs as soon as one fails
fail-fast: true
# steps to run in each job. Some are github actions, others run shell commands
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Set up python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run tests
run: tox -e github-${{ matrix.build-type }} -- -q --nomemory ${{ matrix.pytest-args }}