4444 go-version : 1.21.5
4545 - uses : oven-sh/setup-bun@v2
4646 with :
47- bun-version : 1.1.43
47+ bun-version : 1.3.8
48+ - uses : actions/setup-node@v4
49+ with :
50+ node-version : ' 20'
4851 - uses : astral-sh/setup-uv@v6.2.1
4952 with :
5053 version : " 0.9.24"
@@ -67,6 +70,111 @@ jobs:
6770 - name : Substitute EE code (EE logic is behind feature flag)
6871 run : |
6972 ./substitute_ee_code.sh --copy --dir ./windmill-ee-private
73+ - name : Setup private npm registry with test package
74+ working-directory : /tmp
75+ run : |
76+ set -e
77+
78+ # Install Verdaccio globally
79+ npm install -g verdaccio
80+
81+ # Create Verdaccio config that requires authentication for @windmill-test packages
82+ mkdir -p /tmp/verdaccio/storage
83+ cat > /tmp/verdaccio/config.yaml << 'VERDACCIO_CONFIG'
84+ storage: /tmp/verdaccio/storage
85+ auth:
86+ htpasswd:
87+ file: /tmp/verdaccio/htpasswd
88+ max_users: 100
89+ uplinks:
90+ npmjs:
91+ url: https://registry.npmjs.org/
92+ packages:
93+ '@windmill-test/*':
94+ access: $authenticated
95+ publish: $authenticated
96+ '@*/*':
97+ access: $all
98+ publish: $authenticated
99+ proxy: npmjs
100+ '**':
101+ access: $all
102+ publish: $authenticated
103+ proxy: npmjs
104+ server:
105+ keepAliveTimeout: 60
106+ middlewares:
107+ audit:
108+ enabled: true
109+ log: { type: stdout, format: pretty, level: warn }
110+ VERDACCIO_CONFIG
111+
112+ # Create empty htpasswd file (users will be created via API)
113+ touch /tmp/verdaccio/htpasswd
114+
115+ # Start Verdaccio in background
116+ verdaccio --config /tmp/verdaccio/config.yaml &
117+ VERDACCIO_PID=$!
118+
119+ # Wait for Verdaccio to be ready
120+ echo "Waiting for Verdaccio to start..."
121+ for i in {1..30}; do
122+ if curl -s http://localhost:4873/-/ping > /dev/null 2>&1; then
123+ echo "Verdaccio is ready"
124+ break
125+ fi
126+ sleep 1
127+ done
128+
129+ # Login to get a token
130+ echo "Getting auth token..."
131+ RESPONSE=$(curl -s -X PUT \
132+ -H "Content-Type: application/json" \
133+ -d '{"name":"testuser","password":"testpass123"}' \
134+ http://localhost:4873/-/user/org.couchdb.user:testuser)
135+
136+ echo "Auth response: $RESPONSE"
137+ NPM_TOKEN=$(echo "$RESPONSE" | jq -r '.token')
138+
139+ if [ -z "$NPM_TOKEN" ] || [ "$NPM_TOKEN" = "null" ]; then
140+ echo "Failed to get NPM token from response"
141+ exit 1
142+ fi
143+
144+ echo "NPM_TOKEN=${NPM_TOKEN}" >> $GITHUB_ENV
145+ echo "Got NPM token successfully: ${NPM_TOKEN:0:10}..."
146+
147+ # Configure npm globally with the auth token
148+ echo "//localhost:4873/:_authToken=${NPM_TOKEN}" > ~/.npmrc
149+ echo "Configured ~/.npmrc with auth token"
150+
151+ # Create a simple test package
152+ mkdir -p /tmp/windmill-test-private-pkg
153+ cat > /tmp/windmill-test-private-pkg/package.json << 'PKG_JSON'
154+ {
155+ "name": "@windmill-test/private-pkg",
156+ "version": "1.0.0",
157+ "main": "index.js"
158+ }
159+ PKG_JSON
160+ cat > /tmp/windmill-test-private-pkg/index.js << 'PKG_JS'
161+ module.exports.greet = (name) => `Hello from private package, ${name}!`;
162+ PKG_JS
163+
164+ # Publish to Verdaccio with auth
165+ cd /tmp/windmill-test-private-pkg
166+ echo "Publishing package..."
167+ npm publish --registry http://localhost:4873
168+ echo "Package published successfully"
169+
170+ # Verify the package requires auth by trying anonymous access (should fail)
171+ rm -f ~/.npmrc
172+ echo "Testing anonymous access (should fail)..."
173+ if npm view @windmill-test/private-pkg --registry http://localhost:4873 2>/dev/null; then
174+ echo "ERROR: Package should require authentication but anonymous access worked"
175+ exit 1
176+ fi
177+ echo "Verified: Package requires authentication for @windmill-test/private-pkg"
70178 - name : Cache DuckDB FFI module build
71179 uses : actions/cache@v3
72180 with :
@@ -84,9 +192,10 @@ jobs:
84192 RUST_LOG_STYLE : never
85193 CARGO_NET_GIT_FETCH_WITH_CLI : true
86194 WMDEBUG_FORCE_V0_WORKSPACE_DEPENDENCIES : 1
87- WMDEBUG_FORCE_RUNNABLE_SETTINGS_V0 : 1
195+ WMDEBUG_FORCE_RUNNABLE_SETTINGS_V0 : 1
88196 WMDEBUG_FORCE_NO_LEGACY_DEBOUNCING_COMPAT : 1
197+ TEST_NPM_REGISTRY : " http://localhost:4873/:_authToken=${{ env.NPM_TOKEN }}"
89198 run : |
90- deno --version && bun -v && go version && python3 --version
199+ deno --version && bun -v && node --version && go version && python3 --version
91200 cd windmill-duckdb-ffi-internal && ./build_dev.sh && cd ..
92- DENO_PATH=$(which deno) BUN_PATH=$(which bun) GO_PATH=$(which go) UV_PATH=$(which uv) cargo test --features enterprise,deno_core,duckdb,license,python,rust,scoped_cache,parquet,private --all -- --nocapture
201+ DENO_PATH=$(which deno) BUN_PATH=$(which bun) NODE_BIN_PATH=$(which node) GO_PATH=$(which go) UV_PATH=$(which uv) cargo test --features enterprise,deno_core,duckdb,license,python,rust,scoped_cache,parquet,private,private_registry_test --all -- --nocapture
0 commit comments