fix tag validation #15
Workflow file for this run
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 Pipeline | |
on: | |
push: | |
tags: | |
- '*' | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.9', '3.10', '3.11'] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache virtualenv | |
uses: actions/cache@v4 | |
with: | |
path: venv | |
key: deps1-${{ matrix.python-version }}-${{ github.ref }}-${{ hashFiles('requirements.txt') }} | |
restore-keys: | | |
deps1-${{ matrix.python-version }}-${{ github.ref }}- | |
- name: Install dependencies | |
run: | | |
python -m venv venv | |
source venv/bin/activate | |
python setup.py develop | |
pip install -r dev_requirements.txt | |
- name: Run tests | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
source venv/bin/activate | |
mkdir junit || true | |
nosetests --with-xunit --with-coverage --cover-package=opentmi_client --cover-html --cover-html-dir=htmlcov --cover-xml-file=coverage.xml --xunit-file=junit/results.xml | |
coveralls || true | |
- name: lint | |
if: matrix.python-version == '3.10' | |
run: | | |
source venv/bin/activate | |
pylint opentmi_client | |
- name: Upload coverage to Coveralls | |
run: coveralls || true | |
- name: Archive coverage reports | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Coverage Report for Python ${{ matrix.python-version }} | |
path: htmlcov | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Test Results for Python ${{ matrix.python-version }} | |
path: junit | |
deploy: | |
runs-on: ubuntu-20.04 | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: test | |
permissions: | |
id-token: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
python -m venv venv | |
source venv/bin/activate | |
python setup.py develop | |
pip install twine | |
pip install -r dev_requirements.txt | |
- name: Verify git tag vs. version | |
run: | | |
source venv/bin/activate | |
python setup.py verify | |
- name: Create packages | |
run: | | |
source venv/bin/activate | |
python setup.py sdist | |
python setup.py bdist_wheel | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |