Skip to content

Commit

Permalink
add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
corentincarton committed Feb 14, 2024
1 parent ad3969a commit 78f6066
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: ci-tracksuite

# Controls when the workflow will run
on:
push:
branches: [ "master", "develop" ]
pull_request:
branches: [ "master", "develop" ]

jobs:
qa:
name: qa
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
- run: pip install black flake8 isort
- run: isort --check .
- run: black --check .
- run: flake8 .

setup:
name: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: python -m pip install -r requirements.txt
- run: python -m pip install .

test:
name: pytest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: python -m pip install -r requirements.txt
- run: python -m pip install pytest
- run: python -m pip install .
- run: python -m pytest .
57 changes: 57 additions & 0 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: on-push

on:
push:
branches:
- main
tags:
- "*"
pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash -l {0}

jobs:
setup:
name: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: python -m pip install -r requirements.txt
- run: python -m pip install .

test:
name: pytest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: python -m pip install -r requirements.txt
- run: python -m pip install pytest
- run: python -m pip install .
- run: python -m pytest .

distribution:
runs-on: ubuntu-latest
needs: [setup, test]

steps:
- uses: actions/checkout@v3
- name: Build distributions
run: |
$CONDA/bin/python -m pip install build
$CONDA/bin/python -m build
- name: Publish a Python distribution to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
gitpython >= 3.1.25
paramiko

0 comments on commit 78f6066

Please sign in to comment.