Skip to content

set env vars multiple times #443

set env vars multiple times

set env vars multiple times #443

Workflow file for this run

name: Tests
on:
push:
branches:
- main
paths:
- src/**
pull_request:
branches:
- main
paths:
- src/**
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev]
# Test the py:light -> ipynb -> py:light round trip conversion
- name: roundtrip conversion test
run: jupytext src/tess_atlas/notebook_controllers/templates/toi_template.py --to notebook --test
# Verify pre-commits valid
- name: pre-commit
run: pre-commit run --all-files --verbose --show-diff-on-failure
# Run all test other than ones marked as "slow"
- name: pytest
run: |
pytest tests/ --cov=tess_atlas --cov-report=xml --cov-report=term-missing:skip-covered | tee pytest-coverage.txt
if: always()
- name: Pytest coverage comment
if: ${{ github.ref == 'refs/heads/main' }}
id: coverageComment
uses: MishaKav/pytest-coverage-comment@main
with:
hide-comment: true
pytest-coverage-path: ./pytest-coverage.txt
- name: Update Readme with Coverage Html
if: ${{ github.ref == 'refs/heads/main' }}
run: |
sed -i '/<!-- Pytest Coverage Comment:Begin -->/,/<!-- Pytest Coverage Comment:End -->/c\<!-- Pytest Coverage Comment:Begin -->\n\${{ steps.coverageComment.outputs.content }}\n<!-- Pytest Coverage Comment:End -->' ./README.md
- name: Commit & Push changes to Readme
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions-js/push@master
with:
message: Update coverage on Readme
github_token: ${{ secrets.GITHUB_TOKEN }}