From 3a9e67736040e8f9efb40cae0d81263616bcc76c Mon Sep 17 00:00:00 2001 From: Micha Birklbauer Date: Wed, 10 Jan 2024 17:14:44 +0100 Subject: [PATCH] add gh-actions --- .github/workflows/python-app.yml | 45 ++++++++++++++++++++++++++++++++ tests/tests.py | 15 +++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .github/workflows/python-app.yml create mode 100644 tests/tests.py diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 0000000..bef7085 --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,45 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# Reference workflow provided by (c) GitHub +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: msannika_fdr + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Copy scripts and data to "/tests" + run: | + cp msannika_fdr.py tests + cp data/DSSO_Crosslinks.xlsx . + cp data/DSSO_CSMs.xlsx . + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest tests/tests.py diff --git a/tests/tests.py b/tests/tests.py new file mode 100644 index 0000000..63ca223 --- /dev/null +++ b/tests/tests.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 + +# MS ANNIKA FDR VALIDATOR - TESTS +# 2024 (c) Micha Johannes Birklbauer +# https://github.com/michabirklbauer/ +# micha.birklbauer@gmail.com + +# test 1 +def test1_msannika_fdr(): + + from msannika_fdr import main + + result = main(["DSSO_CSMs.xlsx"]) + + assert True