Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 62 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,29 @@ executors:
# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
jobs:
build_distribution:
parameters:
version:
description: "version tag"
default: "latest"
type: string
executor:
name: python-docker
version: <<parameters.version>>
steps:
- checkout
- run:
name: install build dependencies
command: pip install ".[deploy]"
- run:
name: Build distribution artifacts
command: |
python -m build
- persist_to_workspace:
root: .
paths:
- dist

test_source:
parameters:
version:
Expand Down Expand Up @@ -54,18 +77,13 @@ jobs:
version: <<parameters.version>>
steps:
- checkout
- run:
name: install dependencies
command: pip install ".[deploy,tests]"
- run:
name: Build wheel
command: |
python -m build --wheel
- attach_workspace:
at: /tmp/workspace
- run:
name: Install wheel in isolated venv and run tests
command: |
python -m venv .wheeltest
WHEEL=$(ls -1 dist/*.whl | head -n 1)
WHEEL=$(ls -1 /tmp/workspace/dist/*.whl | head -n 1)
.wheeltest/bin/python -m pip install "${WHEEL}[tests]"
TEST_PYTHON="$(pwd)/.wheeltest/bin/python"
rm -rf /tmp/spharpy-wheel-tests
Expand Down Expand Up @@ -147,6 +165,8 @@ jobs:
version: <<parameters.version>>
steps:
- checkout
- attach_workspace:
at: /tmp/workspace
# - run:
# name: Install System Dependencies
# command: sudo apt-get update && sudo apt-get install -y libsndfile1
Expand All @@ -155,9 +175,8 @@ jobs:
command: pip install ".[deploy]"
- run:
name: deploy
command: | # create whl, install twine and publish to Test PyPI
python -m build
twine check dist/*
command: |
twine check /tmp/workspace/dist/*

run_pypi_publish:
parameters:
Expand All @@ -170,6 +189,8 @@ jobs:
version: <<parameters.version>>
steps:
- checkout
- attach_workspace:
at: /tmp/workspace
- run:
name: Install System Dependencies
command: sudo apt-get update && sudo apt-get install -y libsndfile1
Expand All @@ -178,10 +199,9 @@ jobs:
command: pip install ".[deploy]"
- run:
name: deploy
command: | # create whl, install twine and publish to Test PyPI
python -m build
twine check dist/*
twine upload dist/*
command: |
twine check /tmp/workspace/dist/*
twine upload /tmp/workspace/dist/*

# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
Expand All @@ -198,6 +218,14 @@ workflows:
- "3.13"
- "3.14"

- build_distribution:
matrix:
parameters:
version:
- "3.14"
requires:
- test_source

- ruff:
matrix:
parameters:
Expand All @@ -214,6 +242,8 @@ workflows:
- "3.12"
- "3.13"
- "3.14"
requires:
- build_distribution

- test_documentation_build:
matrix:
Expand All @@ -238,6 +268,7 @@ workflows:
- "3.14"
requires:
- test_source
- build_distribution


test_and_publish:
Expand All @@ -260,6 +291,20 @@ workflows:
tags:
only: /^v[0-9]+(\.[0-9]+)*$/

- build_distribution:
matrix:
parameters:
version:
- "3.14"
filters:
branches:
ignore: /.*/
# only act on version tags
tags:
only: /^v[0-9]+(\.[0-9]+)*$/
requires:
- test_source

- ruff:
matrix:
parameters:
Expand All @@ -284,6 +329,7 @@ workflows:
- "3.14"
requires:
- test_source
- build_distribution
filters:
branches:
ignore: /.*/
Expand Down Expand Up @@ -327,6 +373,7 @@ workflows:
requires:
- test_source
- test_wheel
- build_distribution
- ruff
- test_documentation_build
filters:
Expand Down
Loading