Skip to content

Commit

Permalink
fix(ci): add GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
centaurialpha committed May 10, 2022
1 parent 649d47b commit 0b74b7d
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 33 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
relative_files = True
75 changes: 75 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: CI

on:
push:
paths-ignore:
- "*.md"

jobs:
build:
# For compatibility with Python 3.4
runs-on: ubuntu-18.04
strategy:
matrix:
python-version: ["3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"]
defaults:
run:
shell: bash

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

- name: Prepare Environment
run: |
python -m pip install --upgrade pip
pip install pytest==3.8.2
pip install coveralls
pip install -e ".[dev]"
- name: Flake8
run: |
flake8 quaternions
- name: Tests (3.4)
# Avoid .coveragerc in 3.4
if:
matrix.python-version == 3.4
run : |
pytest -v tests/
- name: Tests
if:
matrix.python-version >= 3.5
run: |
pytest -v --cov=quaternions --cov-report= tests/
- name: Publish coverage to Coveralls
# If pushed / is a pull request against main repo
if:
((github.event_name == 'push' && github.repository == 'satellogic/quaternions') ||
github.event.pull_request.base.repo.full_name == 'satellogic/quaternions') && matrix.python-version >= 3.5
uses: AndreMiras/coveralls-python-action@v20201129
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: py${{ matrix.python-version }}
parallel: true
debug: true

coveralls-finish:
needs: build
# If pushed / is a pull request against main repo
if:
(github.event_name == 'push' && github.repository == 'satellogic/quaternions') ||
github.event.pull_request.base.repo.full_name == 'satellogic/quaternions'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Coveralls finished
uses: AndreMiras/coveralls-python-action@v20201129
with:
parallel-finished: true
debug: true
32 changes: 0 additions & 32 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
Expand Up @@ -2,7 +2,7 @@ Quaternions library
===================

[![Coverage Status](https://coveralls.io/repos/github/satellogic/quaternions/badge.svg)](https://coveralls.io/github/satellogic/quaternions)
[![Build Status](https://travis-ci.org/satellogic/quaternions.svg?branch=add_travis_ci)](https://travis-ci.org/satellogic/quaternions)
[![CI](https://github.com/satellogic/quaternions/actions/workflows/cicd.yml/badge.svg)](https://github.com/satellogic/quaternions/actions/workflows/cicd.yml)

This is a library for dealing with quaternions in python in a unified way.

Expand Down

0 comments on commit 0b74b7d

Please sign in to comment.