Skip to content

Commit

Permalink
Merge pull request #212 from sentinel-hub/feat/github-actions
Browse files Browse the repository at this point in the history
Switch from travis to github actions
  • Loading branch information
AleksMat committed Oct 6, 2021
2 parents ab52d3c + e5a0818 commit e6e39b4
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 45 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/ci_action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: build

on:
push:
schedule:
- cron: '0 0 * * *'

jobs:
test-on-github:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
steps:
- name: Check out current branch in case of a push event
if: github.event_name == 'push'
uses: actions/checkout@v2

- name: Check out develop branch in case of a scheduled event
if: github.event_name == 'schedule'
uses: actions/checkout@v2
with:
ref: develop

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64

- name: Install packages
run: |
sudo apt-get update
sudo apt-get install -y libopenjp2-7
pip install -e .[DEV]
- name: Run full tests and code coverage
if: matrix.python-version == '3.8'
run: |
sentinelhub.config \
--sh_client_id "${{ secrets.SH_CLIENT_ID }}" \
--sh_client_secret "${{ secrets.SH_CLIENT_SECRET }}" \
--instance_id "${{ secrets.INSTANCE_ID }}" \
--aws_access_key_id "${{ secrets.AWS_ACCESS_KEY_ID }}" \
--aws_secret_access_key "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
pytest --cov -c=.coveragerc --cov-report=term --cov-report=xml
- name: Run pylint and reduced tests
if: matrix.python-version != '3.8'
run: |
pylint sentinelhub
pytest -m "not sh_integration and not aws_integration"
- name: Upload code coverage
if: matrix.python-version == '3.8'
uses: codecov/codecov-action@v2
with:
files: coverage.xml
fail_ci_if_error: true
verbose: false

mirror-and-integration-test-on-gitlab:
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Mirror + trigger CI
uses: SvanBoxel/gitlab-mirror-and-ci-action@master
with:
args: "https://git.sinergise.com/eo/code/sentinelhub-py-dev/"
env:
GITLAB_HOSTNAME: "git.sinergise.com"
GITLAB_USERNAME: "github-action"
GITLAB_PASSWORD: ${{ secrets.GITLAB_PASSWORD }}
GITLAB_PROJECT_ID: "354"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14 changes: 14 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
image: python:3.9

stages:
- test

run_sh_integration_tests:
stage: test
when: always
before_script:
- apt-get update
- apt-get install -y libopenjp2-7
script:
- pip install -e .[DEV]
- pytest -m "sh_integration"
44 changes: 0 additions & 44 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Package version](https://badge.fury.io/py/sentinelhub.svg)](https://pypi.org/project/sentinelhub/)
[![Conda version](https://img.shields.io/conda/vn/conda-forge/sentinelhub.svg)](https://anaconda.org/conda-forge/sentinelhub)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/sentinelhub.svg?style=flat-square)](https://pypi.org/project/sentinelhub/)
[![Build status](https://www.travis-ci.com/sentinel-hub/sentinelhub-py.svg?branch=master)](https://travis-ci.com/github/sentinel-hub/sentinelhub-py/builds)
[![Build Status](https://github.com/sentinel-hub/sentinelhub-py/actions/workflows/ci_action.yml/badge.svg?branch=master)](https://github.com/sentinel-hub/sentinelhub-py/actions)
[![Docs status](https://readthedocs.org/projects/sentinelhub-py/badge/?version=latest)](http://sentinelhub-py.readthedocs.io/en/latest/)
[![Overall downloads](https://pepy.tech/badge/sentinelhub)](https://pepy.tech/project/sentinelhub)
[![Last month downloads](https://pepy.tech/badge/sentinelhub/month)](https://pepy.tech/project/sentinelhub)
Expand Down

0 comments on commit e6e39b4

Please sign in to comment.