|
name: Test |
|
|
|
on: |
|
pull_request: |
|
push: |
|
branches: |
|
- main |
|
|
|
jobs: |
|
test: |
|
runs-on: ubuntu-latest |
|
steps: |
|
- name: Check out SDK |
|
uses: actions/checkout@v7 |
|
|
|
- name: Check out OCLP standard |
|
uses: actions/checkout@v7 |
|
with: |
|
repository: EvanZ/open-computation-lifecycle |
|
path: standard |
|
|
|
- name: Check out OCLP profiles |
|
uses: actions/checkout@v7 |
|
with: |
|
repository: EvanZ/oclp-profiles |
|
path: profiles |
|
|
|
- name: Set up Python |
|
uses: actions/setup-python@v6 |
|
with: |
|
python-version: "3.12" |
|
|
|
- name: Install uv |
|
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 |
|
with: |
|
version: "0.11.32" |
|
enable-cache: false |
|
|
|
- name: Install dependencies |
|
run: uv sync --locked --group dev |
|
|
|
- name: Test SDK and external conformance |
|
run: OCLP_STANDARD_ROOT=standard OCLP_PROFILES_ROOT=profiles uv run pytest |
|
|
|
- name: Lint SDK |
|
run: uv run ruff check . |
|
|
|
package-smoke-test: |
|
name: Build and install package |
|
runs-on: ubuntu-latest |
|
steps: |
|
- name: Check out SDK |
|
uses: actions/checkout@v7 |
|
|
|
- name: Set up Python |
|
uses: actions/setup-python@v6 |
|
with: |
|
python-version: "3.12" |
|
|
|
- name: Install uv |
|
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 |
|
with: |
|
version: "0.11.32" |
|
enable-cache: false |
|
|
|
- name: Build distribution artifacts |
|
run: uv build |
|
|
|
- name: Verify source distribution excludes generated example data |
|
run: | |
|
if tar -tzf dist/*.tar.gz | grep -Eq 'examples/bike-demand-service/data/|/\.venv'; then |
|
echo "source distribution contains generated local files" |
|
exit 1 |
|
fi |
|
|
|
- name: Install each distribution into a clean environment |
|
run: | |
|
uv venv --clear .venv-wheel-smoke |
|
uv pip install --python .venv-wheel-smoke/bin/python dist/*.whl |
|
uv venv --clear .venv-sdist-smoke |
|
uv pip install --python .venv-sdist-smoke/bin/python dist/*.tar.gz |
|
|
|
- name: Run import and command-line smoke tests |
|
run: | |
|
.venv-wheel-smoke/bin/python -c "from oclp import Artifact, canonical_json_bytes; assert Artifact and canonical_json_bytes" |
|
.venv-wheel-smoke/bin/oclp --help |
|
.venv-sdist-smoke/bin/python -c "from oclp import Artifact, canonical_json_bytes; assert Artifact and canonical_json_bytes" |
|
.venv-sdist-smoke/bin/oclp --help |
|
|
|
dagster: |
|
name: Test Dagster integration |
|
runs-on: ubuntu-latest |
|
steps: |
|
- name: Check out SDK |
|
uses: actions/checkout@v7 |
|
|
|
- name: Set up Python |
|
uses: actions/setup-python@v6 |
|
with: |
|
python-version: "3.12" |
|
|
|
- name: Install uv |
|
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 |
|
with: |
|
version: "0.11.32" |
|
enable-cache: false |
|
|
|
- name: Install Dagster integration dependencies |
|
run: uv sync --locked --group dev --extra dagster |
|
|
|
- name: Test Dagster adapter |
|
run: uv run pytest tests/test_dagster_adapter.py |