-
Notifications
You must be signed in to change notification settings - Fork 14
78 lines (68 loc) · 2.95 KB
/
Copy pathbuild-python-package.yml
File metadata and controls
78 lines (68 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Build and smoke-test Python package
on:
workflow_call:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: "3.14"
- name: Build and check distributions
run: |
python -m pip install --upgrade pip
python -m pip install build twine
python -m build
python -m twine check dist/*
- name: Smoke test installed wheel
run: |
wheel="$(find dist -maxdepth 1 -name '*.whl' -print -quit)"
test -n "$wheel"
python -m venv "$RUNNER_TEMP/cds-wheel"
"$RUNNER_TEMP/cds-wheel/bin/python" -m pip install "$wheel"
cd "$RUNNER_TEMP"
"$RUNNER_TEMP/cds-wheel/bin/cds" --help
"$RUNNER_TEMP/cds-wheel/bin/cds" validate \
"$GITHUB_WORKSPACE/profiles/local-dagster-postgres-superset/profile.yaml"
"$RUNNER_TEMP/cds-wheel/bin/python" -c \
"from cli.security import _validate_rule_set; assert _validate_rule_set()['rules']"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4
- name: Smoke test full stack via cds get/init/up
# Exercises the real end-user flow: install the built wheel with no
# source checkout on CDS_PROFILE_PATH/CDS_MODULE_PATH, `cds get` a
# profile and its assets into an empty directory, `cds init` it, and
# bring the full docker compose stack up. This is the only check
# that would have caught bugs limited to the packaged/get-fetched
# layout (e.g. missing bundled assets, or project-root resolution
# regressions) rather than the source-checkout install exercised
# above.
run: |
stack_dir="$RUNNER_TEMP/cds-stack-smoke"
rm -rf "$stack_dir"
mkdir -p "$stack_dir"
cd "$stack_dir"
"$RUNNER_TEMP/cds-wheel/bin/cds" get local-dagster-postgres-superset \
--local "$GITHUB_WORKSPACE"
"$RUNNER_TEMP/cds-wheel/bin/cds" init local-dagster-postgres-superset
"$RUNNER_TEMP/cds-wheel/bin/cds" up local-dagster-postgres-superset --timeout 600
- name: Tear down full stack smoke test
if: always()
run: |
stack_dir="$RUNNER_TEMP/cds-stack-smoke"
if [ -f "$stack_dir/docker-compose.yml" ]; then
docker compose -f "$stack_dir/docker-compose.yml" down -v --remove-orphans || true
fi
- name: Upload immutable distributions
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: python-package-distributions
path: dist/
if-no-files-found: error
retention-days: 7