Skip to content
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

[Experimental] Replace Travis with Github Actions #68

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Python application test

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: runner_ensembl_metadata
MYSQL_USER: testuser
MYSQL_PASSWORD: password
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5

strategy:
matrix:
python-version: [3.8, 3.9]

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pip install -r requirements.txt
pip install -r requirements-test.txt
pip install .

- name: Set PYTHONPATH
run: echo "PYTHONPATH=$PYTHONPATH:$GITHUB_WORKSPACE/src" >> $GITHUB_ENV

- name: Start MySQL
run: |
while ! mysqladmin ping -h"127.0.0.1" --silent; do
sleep 1
done

- name: Show DB_HOST ENV
run: echo "DB_HOST ENV ${{ job.services.mysql.ports[3306] }}"

- name: Run tests
env:
DB_HOST: 127.0.0.1
run: |
coverage run -m pytest --server mysql://testuser:[email protected]:3306
File renamed without changes.
Loading