Skip to content

Merge pull request #100 from UBC-MDS/scout-mckee-patch-3 #37

Merge pull request #100 from UBC-MDS/scout-mckee-patch-3

Merge pull request #100 from UBC-MDS/scout-mckee-patch-3 #37

Workflow file for this run

name: ci-cd
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v2
with:
python-version: 3.9
- uses: actions/checkout@v2
- uses: snok/install-poetry@v1
- name: Install package
run: poetry install
- name: Test with pytest
run: poetry run pytest tests/ --cov=datexplore --cov-report=xml
- name: Use Codecov to track coverage
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml # coverage report
- name: Build documentation
run: poetry run make html --directory docs/
cd:
permissions:
id-token: write
contents: write
needs: ci
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v2
with:
python-version: 3.9
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Python Semantic Release
run: |
pip install python-semantic-release
git config user.name github-actions
git config user.email github-actions@github.com
semantic-release publish
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
- name: Test install from TestPyPI
run: |
pip install \
--index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple \
datexplore
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true