feat(FUS-1124): add new unit types #49
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: push | |
jobs: | |
test-and-lint: | |
name: Run Lint and Pytest | |
if: github.ref != 'refs/heads/develop' || contains(github.ref, 'release/') || contains(github.ref, 'tags/v') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Cache pip dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements*.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip-${{ hashFiles('requirements*.txt') }} | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: make install | |
- name: Lint | |
run: make lint | |
- name: Run unit tests | |
run: make test | |
- name: Coverage report | |
run: make coverage | |
deploy: | |
name: Build and publish to PyPI | |
needs: [ test-and-lint ] | |
if: contains(github.ref, 'tags/v') | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/corva-unit-converter | |
permissions: | |
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: pip install -U setuptools wheel | |
- name: Build the package | |
run: python setup.py sdist bdist_wheel | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |