-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
440 additions
and
729 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,39 +2,37 @@ | |
name: Deploy to PyPI | ||
|
||
on: | ||
release: | ||
types: [created] | ||
workflow_call: | ||
inputs: | ||
build_docs: | ||
required: false | ||
type: boolean | ||
default: false | ||
deploy_docs: | ||
required: false | ||
type: boolean | ||
default: false | ||
|
||
jobs: | ||
Deploying: | ||
build_and_publish_pypi: | ||
runs-on: ubuntu-latest | ||
|
||
if: github.repository_owner == 'statnett' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.10 | ||
|
||
- name: Get full python version | ||
id: full-python-version | ||
shell: bash | ||
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") | ||
|
||
- name: Install and configure Poetry | ||
uses: abatilo/[email protected] | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
- name: build package | ||
run: uv build | ||
- name: Publish package distributions to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1.10 | ||
with: | ||
poetry-version: 1.8.3 | ||
|
||
- name: Install dynamic versioning | ||
run: poetry self add "poetry-dynamic-versioning[plugin]" | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
run: poetry install | ||
|
||
- name: Build and publish to PyPI | ||
run: | | ||
poetry config pypi-token.pypi ${{ secrets.pypi_push_token }} | ||
poetry publish --build | ||
repository-url: https://test.pypi.org/legacy/ | ||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1.10 # Use v1.10 https://github.com/pypa/twine/pull/1172 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,35 +10,18 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Get full python version | ||
id: full-python-version | ||
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") | ||
|
||
- name: Install and configure Poetry | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: 1.8.3 | ||
|
||
- name: Set poetry virtualenv to local | ||
run: poetry config virtualenvs.in-project true | ||
|
||
- name: Set up cache | ||
uses: actions/cache@v3 | ||
id: cache | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
|
||
- name: Install dependencies | ||
run: poetry install --no-interaction | ||
run: uv sync | ||
|
||
- name: Linting | ||
run: poetry run pre-commit run --all-files | ||
run: uvx pre-commit run --all-files | ||
|
||
Tests: | ||
needs: Linting | ||
|
@@ -47,8 +30,7 @@ jobs: | |
fail-fast: true | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: ['3.10', '3.11', '3.12'] | ||
poetry-version: [1.8.3] | ||
python-version: ['3.10', '3.11', '3.12', '3.13'] | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
|
@@ -59,40 +41,32 @@ jobs: | |
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install and configure Poetry | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: ${{ matrix.poetry-version }} | ||
|
||
- name: Set poetry virtualenv to local | ||
run: poetry config virtualenvs.in-project true | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
|
||
- name: Get full python version | ||
id: full-python-version | ||
shell: bash | ||
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") | ||
|
||
- name: Set up cache | ||
uses: actions/cache@v3 | ||
id: cache | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
run: poetry install --no-interaction | ||
run: uv sync | ||
|
||
- name: Static type checking | ||
uses: jakebailey/[email protected] | ||
with: | ||
version: 1.1.367 | ||
continue-on-error: true | ||
|
||
- name: Run pytest | ||
if: ${{ ( runner.os != 'Linux' ) || ( matrix.python-version != '3.10' ) }} | ||
run: poetry run pytest -q tests | ||
run: uv run pytest -q tests | ||
|
||
- name: Run pytest with coverage | ||
if: ${{ ( runner.os == 'Linux' ) && ( matrix.python-version == '3.10' ) }} | ||
run: poetry run pytest -q --cov=rawxio --cov-report=xml tests | ||
run: uv run pytest -q --cov=cimsparql --cov-report=xml tests | ||
|
||
- name: Upload coverage | ||
if: ${{ ( runner.os == 'Linux' ) && ( matrix.python-version == '3.10' ) }} | ||
uses: codecov/codecov-action@v3 | ||
uses: codecov/codecov-action@v5 | ||
with: | ||
file: ./coverage.xml | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./coverage.xml | ||
fail_ci_if_error: true |
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
Oops, something went wrong.