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

ci: replace Travis CI with GH Actions #60

Closed
wants to merge 12 commits into from
44 changes: 44 additions & 0 deletions .github/workflows/docker-build-publish-drs-filer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: drs-filer

on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev

jobs:
publish_to_docker:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/dev'

name: Build and publish to Docker
steps:
- name: Checkout repository
uses: actions/[email protected]

- name: Set up Docker Buildx
uses: docker/[email protected]

- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
uniqueg marked this conversation as resolved.
Show resolved Hide resolved

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: elixircloud/drs-filer

- name: Build and push Docker images
uses: docker/[email protected]
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
42 changes: 42 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Lint workflow

on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev

jobs:
linting_and_tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]

name: Run linting and unit tests
steps:
- name: Checkout repository
uses: actions/[email protected]

- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest coverage coveralls

- name: Lint with flake8
run: flake8

- name: Run unit tests with coverage
run: |
coverage run --source drs_filer -m pytest
coverage report -m
coveralls
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
psankhe28 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test Drs-filer API Endpoints

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/[email protected]

- name: Build and run Docker Compose
run: docker-compose up --build -d

- name: Wait for the services to be ready
run: |
echo "Waiting for the services to be ready..."
sleep 30 # Wait for 30 seconds to ensure the services are up
psankhe28 marked this conversation as resolved.
Show resolved Hide resolved
psankhe28 marked this conversation as resolved.
Show resolved Hide resolved

- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest requests

- name: Test with pytest
run: |
pytest tests/test.py -v -p no:warnings
psankhe28 marked this conversation as resolved.
Show resolved Hide resolved
env:
DRS_FILER_URL: http://localhost:8080/ga4gh/drs/v1
61 changes: 0 additions & 61 deletions .travis.yml

This file was deleted.

Loading