2022-12-05 18:11:43 -05:00
|
|
|
---
|
|
|
|
|
2024-10-04 18:20:25 -04:00
|
|
|
name: ♻️ 🧪
|
2022-12-05 17:01:24 -05:00
|
|
|
|
2022-12-05 18:11:43 -05:00
|
|
|
on: # yamllint disable-line rule:truthy
|
2024-10-04 18:20:25 -04:00
|
|
|
workflow_call:
|
2022-12-05 17:01:24 -05:00
|
|
|
|
2022-12-06 16:08:08 -05:00
|
|
|
env:
|
2022-12-06 16:17:42 -05:00
|
|
|
devpi-password: abcd1234
|
|
|
|
devpi-username: root
|
2022-12-06 17:13:58 -05:00
|
|
|
devpi-port: 3141
|
2022-12-06 16:17:42 -05:00
|
|
|
|
2022-12-06 16:08:08 -05:00
|
|
|
FORCE_COLOR: 1 # Request colored output from CLI tools supporting it
|
|
|
|
MYPY_FORCE_COLOR: 1 # MyPy's color enforcement
|
|
|
|
PIP_DISABLE_PIP_VERSION_CHECK: 1
|
|
|
|
PIP_NO_PYTHON_VERSION_WARNING: 1
|
|
|
|
PIP_NO_WARN_SCRIPT_LOCATION: 1
|
|
|
|
PY_COLORS: 1 # Recognized by the `py` package, dependency of `pytest`
|
|
|
|
TOX_PARALLEL_NO_SPINNER: 1
|
|
|
|
TOX_TESTENV_PASSENV: >- # Make tox-wrapped tools see color requests
|
|
|
|
FORCE_COLOR
|
|
|
|
MYPY_FORCE_COLOR
|
|
|
|
NO_COLOR
|
|
|
|
PY_COLORS
|
|
|
|
PYTEST_THEME
|
|
|
|
PYTEST_THEME_MODE
|
|
|
|
|
2022-12-05 17:01:24 -05:00
|
|
|
jobs:
|
2024-07-10 18:40:53 -04:00
|
|
|
fail-fast:
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [macos-latest, windows-latest]
|
|
|
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
timeout-minutes: 2
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Check out the action locally
|
2024-10-04 18:20:25 -04:00
|
|
|
uses: actions/checkout@v4
|
2024-07-10 18:40:53 -04:00
|
|
|
with:
|
|
|
|
path: test
|
|
|
|
- name: Fail-fast in unsupported environments
|
|
|
|
continue-on-error: true
|
|
|
|
id: fail-fast
|
|
|
|
uses: ./test
|
|
|
|
- name: Error if action did not fail-fast in unsupported environments
|
|
|
|
if: steps.fail-fast.outcome == 'success'
|
|
|
|
run: |
|
|
|
|
>&2 echo This action should fail-fast in unsupported environments.
|
|
|
|
exit 1
|
|
|
|
|
2022-12-06 16:06:28 -05:00
|
|
|
smoke-test:
|
2024-10-04 18:20:25 -04:00
|
|
|
|
2022-12-05 17:01:24 -05:00
|
|
|
runs-on: ubuntu-latest
|
2022-12-05 18:11:43 -05:00
|
|
|
|
2022-12-05 17:01:24 -05:00
|
|
|
services:
|
|
|
|
devpi:
|
|
|
|
image: muccg/devpi
|
|
|
|
env:
|
2022-12-06 16:17:42 -05:00
|
|
|
DEVPI_PASSWORD: ${{ env.devpi-password }}
|
2022-12-05 17:01:24 -05:00
|
|
|
ports:
|
2022-12-06 17:18:25 -05:00
|
|
|
- 3141
|
2022-12-05 18:11:43 -05:00
|
|
|
|
2022-12-05 18:16:34 -05:00
|
|
|
timeout-minutes: 2
|
|
|
|
|
2022-12-05 17:01:24 -05:00
|
|
|
steps:
|
2022-12-06 16:30:01 -05:00
|
|
|
- name: Check out the action locally
|
2024-09-29 03:04:41 -04:00
|
|
|
uses: actions/checkout@v4
|
2022-12-06 16:30:01 -05:00
|
|
|
with:
|
|
|
|
path: test
|
2022-12-06 16:26:08 -05:00
|
|
|
- name: Install the packaging-related tools
|
2022-12-06 16:27:07 -05:00
|
|
|
run: python3 -m pip install build twine
|
2022-12-06 16:30:01 -05:00
|
|
|
env:
|
|
|
|
PIP_CONSTRAINT: test/requirements/runtime.txt
|
2022-12-06 16:26:08 -05:00
|
|
|
- name: Create the stub package importable directory
|
2022-12-06 16:26:35 -05:00
|
|
|
run: mkdir -pv src/test_package
|
2022-12-06 16:26:08 -05:00
|
|
|
- name: Populate the stub package `__init__.py`
|
|
|
|
run: echo '__version__ = "0.1"' > src/test_package/__init__.py
|
|
|
|
- name: Populate the stub package `README.md`
|
|
|
|
run: echo "# Test Package" > README.md
|
|
|
|
- name: Populate the stub package `pyproject.toml`
|
|
|
|
run: echo "$CONTENTS" > pyproject.toml
|
2022-12-05 18:11:43 -05:00
|
|
|
env:
|
|
|
|
CONTENTS: |
|
|
|
|
[build-system]
|
2022-12-06 16:20:59 -05:00
|
|
|
requires = [
|
|
|
|
"setuptools == 65.6.3",
|
|
|
|
]
|
2022-12-05 18:11:43 -05:00
|
|
|
build-backend = "setuptools.build_meta"
|
2022-12-06 16:20:59 -05:00
|
|
|
|
2022-12-05 18:11:43 -05:00
|
|
|
[project]
|
|
|
|
name = "test-package"
|
|
|
|
version = "0.1"
|
|
|
|
readme = "README.md"
|
2022-12-06 16:26:08 -05:00
|
|
|
- name: Build the stub package sdist and wheel distributions
|
|
|
|
run: python3 -m build
|
|
|
|
- name: Register the stub package in devpi
|
|
|
|
run: twine register dist/*.tar.gz
|
2022-12-05 18:11:43 -05:00
|
|
|
env:
|
2022-12-06 16:17:42 -05:00
|
|
|
TWINE_USERNAME: ${{ env.devpi-username }}
|
|
|
|
TWINE_PASSWORD: ${{ env.devpi-password }}
|
2022-12-06 17:01:39 -05:00
|
|
|
TWINE_REPOSITORY_URL: >-
|
2022-12-06 17:04:43 -05:00
|
|
|
http://localhost:${{
|
2022-12-06 17:13:58 -05:00
|
|
|
job.services.devpi.ports[env.devpi-port]
|
2022-12-06 17:01:39 -05:00
|
|
|
}}/${{
|
|
|
|
env.devpi-username
|
|
|
|
}}/public/
|
2022-12-06 16:26:08 -05:00
|
|
|
- name: ✅ Smoke-test the locally checked out action
|
|
|
|
uses: ./test
|
2022-12-06 17:55:06 -05:00
|
|
|
env:
|
2022-12-06 20:34:31 -05:00
|
|
|
DEBUG: >-
|
|
|
|
true
|
2022-12-06 17:55:06 -05:00
|
|
|
PATH: utter-nonsense
|
2022-12-05 18:11:43 -05:00
|
|
|
with:
|
2022-12-06 16:17:42 -05:00
|
|
|
user: ${{ env.devpi-username }}
|
|
|
|
password: ${{ env.devpi-password }}
|
2023-03-10 19:18:41 -05:00
|
|
|
repository-url: >-
|
2022-12-06 17:13:58 -05:00
|
|
|
http://devpi:${{ env.devpi-port }}/${{ env.devpi-username }}/public/
|
2022-12-05 18:11:43 -05:00
|
|
|
|
|
|
|
...
|