Skip to content

fix gha

fix gha #11

Workflow file for this run

name: Python Tests
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
- name: Install pytest
run: |
pip install pytest pytest-cov
- name: Run tests
run: |
pytest --cov=gcms_data_analysis --cov-report=term
- name: Generate Badge
run: |
# Example: Generate badge based on test coverage percentage
COVERAGE=$(pytest --cov-report=xml | grep -oP '(?<=<report.*line-rate=")[^"]*')
curl "https://img.shields.io/badge/coverage-$COVERAGE-green.svg" > coverage.svg
- name: Upload Badge
uses: actions/upload-artifact@v2
with:
name: coverage-badge
path: coverage.svg