diff --git a/.github/workflows/build-test-publish.yml b/.github/workflows/build-test-publish.yml index 3fd7030..40378b3 100644 --- a/.github/workflows/build-test-publish.yml +++ b/.github/workflows/build-test-publish.yml @@ -4,10 +4,11 @@ name: Build on: + pull_request: push: - branches: ["*"] - pull_request: [main] + branches: [main] tags: ["v*.*.*"] + workflow_dispatch: jobs: test: @@ -22,33 +23,19 @@ jobs: - "3.11" - "3.12" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{matrix.python_version}} - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: + cache: pip + cache-dependency-path: pyproject.toml python-version: ${{matrix.python_version}} - - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{runner.os}}-pip-${{hashFiles('pyproject.toml')}} - restore-keys: | - ${{runner.os}}-pip- - ${{runner.os}}- - name: Upgrade Pip - run: |- - python -m pip install -U pip - - name: Add git PAT - run: |- - git config --global --add url."https://${{ secrets.PAT_GITHUB }}@github".insteadOf https://github - - name: Pre-install private Github dependencies - run: |- - python -m pip install git+https://github.com/DSD-DBS/polarion-rest-api-client.git@v0.4.0 + run: python -m pip install -U pip - name: Install test dependencies - run: |- - python -m pip install '.[test]' + run: python -m pip install '.[test]' - name: Run unit tests - run: |- - python -m pytest --cov-report=term --cov=capella2polarion --rootdir=. + run: python -m pytest --cov-report=term --cov=capellambse --rootdir=. build: name: Build wheel @@ -75,6 +62,23 @@ jobs: name: python-package-distributions path: dist/ if-no-files-found: error + + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + cache: pip + cache-dependency-path: pyproject.toml + python-version: "3.12" + - name: Upgrade pip + run: python -m pip install -U pip + - name: Install pre-commit + run: python -m pip install pre-commit + - name: Run Pre-Commit + run: pre-commit run --all-files + pypi: name: Publish to PyPI runs-on: ubuntu-latest diff --git a/README.md b/README.md index bb93e52..d6cb120 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Read the [full documentation on GitHub](https://dsd-dbs.github.io/capella-polari We have a dependency on [cairosvg](https://cairosvg.org/). Please check their [documentation](https://cairosvg.org/documentation/) for OS specific dependencies. -You can install the latest released version directly from PyPI (**Not yet**). +You can install the latest released version directly from [PyPI](https://pypi.org/project/capella2polarion/). ```zsh pip install capella2polarion