-
Notifications
You must be signed in to change notification settings - Fork 0
163 lines (155 loc) · 6.36 KB
/
Copy pathci.yml
File metadata and controls
163 lines (155 loc) · 6.36 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# TEMPORARILY DISABLED - commenting out the entire file until we re-enable CI for the Rust core.
# The CI workflow is currently configured to run on every push and PR to main and develop, but we want
# to disable it for now while we focus on the Go SDK and stabilize the core.
# name: QueueFlow Core (Rust) CI
# on:
# push:
# branches: [main, develop]
# pull_request:
# branches: [main]
# env:
# CARGO_TERM_COLOR: always
# # Pinned so codegen output is reproducible across local runs and CI.
# OPENAPI_GENERATOR_IMAGE: openapitools/openapi-generator-cli:v7.10.0
# jobs:
# rust:
# name: fmt + clippy + tests
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: dtolnay/rust-toolchain@1.96.0
# with:
# components: rustfmt, clippy
# - uses: Swatinem/rust-cache@v2
# - name: Format
# run: cargo fmt --all --check
# - name: Clippy
# run: cargo clippy --workspace --all-targets -- -D warnings
# - name: Tests (no database)
# run: cargo test --workspace
# spec:
# name: OpenAPI spec (generate + no-drift + validate)
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: dtolnay/rust-toolchain@1.96.0
# - uses: Swatinem/rust-cache@v2
# - name: Generate spec from code
# run: cargo run -q -p queueflow-server -- spec --output-dir spec
# - name: Assert the committed spec is in sync with the code
# run: |
# if ! git diff --exit-code -- spec/; then
# echo "::error::spec/ is out of date. Run 'make spec' and commit the result." >&2
# exit 1
# fi
# - name: Validate spec
# run: |
# docker run --rm -v "${{ github.workspace }}/spec:/spec:ro" \
# "${OPENAPI_GENERATOR_IMAGE}" validate -i /spec/openapi.json
# - name: Upload spec artifact
# uses: actions/upload-artifact@v4
# with:
# name: openapi-spec
# path: spec/
# sdk-codegen:
# name: SDK codegen + facade compiles (python, go)
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-go@v5
# with:
# go-version: "1.24"
# # Regenerate the Python + Go SDKs (generated core + injected facade) from
# # the committed spec, templates, and configs, into throwaway dirs. This
# # guards the hand-written facade templates against codegen drift (e.g. a
# # facade symbol colliding with or renamed in the generated core).
# - name: Generate Go SDK and compile (core + facade)
# run: |
# out="$(mktemp -d)"
# docker run --rm \
# -v "${{ github.workspace }}/spec/openapi.json:/spec/openapi.json:ro" \
# -v "${{ github.workspace }}/sdk-configs/go.yaml:/config.yaml:ro" \
# -v "${{ github.workspace }}/sdk-templates/go:/templates:ro" \
# -v "${out}:/out" \
# "${OPENAPI_GENERATOR_IMAGE}" generate -i /spec/openapi.json -c /config.yaml -o /out
# test -f "${out}/facade.go" || { echo "::error::go facade was not generated" >&2; exit 1; }
# (cd "${out}" && go build ./...)
# - name: Generate Python SDK and byte-compile facade
# run: |
# out="$(mktemp -d)"
# docker run --rm \
# -v "${{ github.workspace }}/spec/openapi.json:/spec/openapi.json:ro" \
# -v "${{ github.workspace }}/sdk-configs/python.yaml:/config.yaml:ro" \
# -v "${{ github.workspace }}/sdk-templates/python:/templates:ro" \
# -v "${out}:/out" \
# "${OPENAPI_GENERATOR_IMAGE}" generate -i /spec/openapi.json -c /config.yaml -o /out
# test -f "${out}/queueflow/facade.py" || { echo "::error::python facade was not generated" >&2; exit 1; }
# python3 -m py_compile "${out}/queueflow/facade.py"
# ts-sdk-drift:
# name: TypeScript SDK drift guard
# runs-on: ubuntu-latest
# # The TS SDK is a separate repo (generated core/ + hand-written facade src/).
# # This job checks it out next to the spec and asserts the generated core
# # covers every spec operation and the facade surfaces every tag group.
# #
# # Requires:
# # - the SDK repo to live under the same owner as this repo (adjust below);
# # - its generated core/ committed;
# # - secrets.SDK_REPO_TOKEN: a PAT with read access, IF the SDK repo is
# # private. Omit for a public SDK repo.
# steps:
# - name: Checkout core (spec lives here)
# uses: actions/checkout@v4
# - name: Checkout TypeScript SDK
# uses: actions/checkout@v4
# with:
# repository: ${{ github.repository_owner }}/queueflow-sdk-nodejs
# token: ${{ secrets.SDK_REPO_TOKEN || github.token }}
# path: .sdk-ts
# - uses: actions/setup-node@v4
# with:
# node-version: "20"
# - name: Check generated core + facade against the spec
# env:
# QUEUEFLOW_SDK_DIR: ${{ github.workspace }}/.sdk-ts
# run: node ./scripts/check-ts-sdk.mjs
# postgres:
# name: Postgres integration
# runs-on: ubuntu-latest
# services:
# postgres:
# # Any plain PostgreSQL 13+ works; no extensions required.
# image: postgres:16-alpine
# env:
# POSTGRES_PASSWORD: postgres
# POSTGRES_DB: queueflow_test
# ports:
# - 5432:5432
# options: >-
# --health-cmd pg_isready
# --health-interval 10s
# --health-timeout 5s
# --health-retries 5
# steps:
# - uses: actions/checkout@v4
# - uses: dtolnay/rust-toolchain@1.96.0
# - uses: Swatinem/rust-cache@v2
# - name: Integration tests
# run: cargo test -p queueflow-core --features postgres --test pg_integration
# env:
# TEST_DATABASE_URL: postgres://postgres:postgres@localhost:5432/queueflow_test
# docker:
# name: Docker build
# runs-on: ubuntu-latest
# needs: [rust]
# steps:
# - uses: actions/checkout@v4
# - uses: docker/setup-buildx-action@v3
# - name: Build image
# uses: docker/build-push-action@v6
# with:
# context: .
# push: false
# tags: ghcr.io/${{ github.repository_owner }}/queueflow:ci
# cache-from: type=gha
# cache-to: type=gha,mode=max