Skip to content

Commit 12e98ee

Browse files
committed
Oops...needed to fix a dependency...
1 parent 8d433d5 commit 12e98ee

File tree

6 files changed

+127
-34
lines changed

6 files changed

+127
-34
lines changed

.github/workflows/CI.yml

Lines changed: 89 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ env:
44
DEBUG: napi:*
55
APP_NAME: python-node
66
MACOSX_DEPLOYMENT_TARGET: '10.13'
7+
CARGO_NET_GIT_FETCH_WITH_CLI: 'true'
78

89
permissions:
910
contents: write
@@ -23,6 +24,10 @@ on:
2324
- docs/**
2425
pull_request:
2526

27+
concurrency:
28+
group: ${{ github.workflow }}-${{ github.ref }}-ci
29+
cancel-in-progress: true
30+
2631
jobs:
2732
build:
2833
strategy:
@@ -90,6 +95,8 @@ jobs:
9095
run: |
9196
set -x
9297
98+
export CARGO_NET_GIT_FETCH_WITH_CLI=true
99+
93100
# Install apt dependencies
94101
apt-get update -y
95102
apt-get install -y openssh-client
@@ -98,15 +105,42 @@ jobs:
98105
corepack disable
99106
npm i -gf pnpm
100107
101-
# Set up SSH key (to checkout private repos with cargo)
108+
# Set up SSH keys (to checkout private repos with cargo)
102109
mkdir -p ~/.ssh
103-
chmod -R 400 ~/.ssh
104-
touch ~/.ssh/config ~/.ssh/known_hosts
105-
eval `ssh-agent -s`
106-
echo "${{ secrets.HTTP_HANDLER_ACCESS_TOKEN }}" | tr -d '\r' | ssh-add -
107-
echo "${{ secrets.HTTP_REWRITER_ACCESS_TOKEN }}" | tr -d '\r' | ssh-add -
108-
ssh-add -l
109-
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
110+
chmod 700 ~/.ssh
111+
112+
# Save SSH keys to files
113+
echo "${{ secrets.HTTP_HANDLER_ACCESS_TOKEN }}" | tr -d '\r' > ~/.ssh/http_handler_key
114+
echo "${{ secrets.HTTP_REWRITER_ACCESS_TOKEN }}" | tr -d '\r' > ~/.ssh/http_rewriter_key
115+
chmod 600 ~/.ssh/http_handler_key
116+
chmod 600 ~/.ssh/http_rewriter_key
117+
118+
# Add GitHub to known hosts (for all aliases)
119+
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
120+
121+
# Create SSH config with host aliases
122+
cat > ~/.ssh/config <<'EOF'
123+
Host github.com-http-handler
124+
HostName github.com
125+
User git
126+
IdentityFile ~/.ssh/http_handler_key
127+
IdentitiesOnly yes
128+
129+
Host github.com-http-rewriter
130+
HostName github.com
131+
User git
132+
IdentityFile ~/.ssh/http_rewriter_key
133+
IdentitiesOnly yes
134+
EOF
135+
chmod 600 ~/.ssh/config
136+
137+
# Configure git to rewrite URLs to use the correct host alias
138+
git config --global url."ssh://git@github.com-http-handler/platformatic/http-handler".insteadOf "ssh://git@github.com/platformatic/http-handler"
139+
git config --global url."ssh://git@github.com-http-rewriter/platformatic/http-rewriter".insteadOf "ssh://git@github.com/platformatic/http-rewriter"
140+
141+
# Also handle variations without .git suffix
142+
git config --global url."ssh://git@github.com-http-handler/platformatic/http-handler.git".insteadOf "ssh://git@github.com/platformatic/http-handler.git"
143+
git config --global url."ssh://git@github.com-http-rewriter/platformatic/http-rewriter.git".insteadOf "ssh://git@github.com/platformatic/http-rewriter.git"
110144
111145
${{ matrix.settings.build }}
112146
- name: Build
@@ -160,6 +194,14 @@ jobs:
160194
- name: List packages
161195
run: ls -R .
162196
shell: bash
197+
- name: Check test directory
198+
run: |
199+
echo "Current directory: $(pwd)"
200+
echo "Test directory contents:"
201+
ls -la test/ || echo "test/ directory not found"
202+
echo "Looking for test files:"
203+
find . -name "*.test.mjs" -type f || echo "No test files found"
204+
shell: bash
163205
- run: cargo test
164206
- run: pnpm test
165207

@@ -232,23 +274,52 @@ jobs:
232274
run: |
233275
set -x
234276
277+
export CARGO_NET_GIT_FETCH_WITH_CLI=true
278+
235279
# Install apt dependencies
236280
apt-get update -y
237-
apt-get install -y openssh-client curl
281+
apt-get install -y openssh-client curl git build-essential python3
238282
239283
# Install rust toolchain
240284
curl https://sh.rustup.rs -sSf | bash -s -- -y -t ${{ matrix.settings.target }}
241-
source "$HOME/.cargo/env"
285+
. "$HOME/.cargo/env"
242286
243-
# Set up SSH key (to checkout private repos with cargo)
287+
# Set up SSH keys (to checkout private repos with cargo)
244288
mkdir -p ~/.ssh
245-
chmod -R 400 ~/.ssh
246-
touch ~/.ssh/config ~/.ssh/known_hosts
247-
eval `ssh-agent -s`
248-
echo "${{ secrets.HTTP_HANDLER_ACCESS_TOKEN }}" | tr -d '\r' | ssh-add -
249-
echo "${{ secrets.HTTP_REWRITER_ACCESS_TOKEN }}" | tr -d '\r' | ssh-add -
250-
ssh-add -l
251-
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
289+
chmod 700 ~/.ssh
290+
291+
# Save SSH keys to files
292+
echo "${{ secrets.HTTP_HANDLER_ACCESS_TOKEN }}" | tr -d '\r' > ~/.ssh/http_handler_key
293+
echo "${{ secrets.HTTP_REWRITER_ACCESS_TOKEN }}" | tr -d '\r' > ~/.ssh/http_rewriter_key
294+
chmod 600 ~/.ssh/http_handler_key
295+
chmod 600 ~/.ssh/http_rewriter_key
296+
297+
# Add GitHub to known hosts (for all aliases)
298+
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
299+
300+
# Create SSH config with host aliases
301+
cat > ~/.ssh/config <<'EOF'
302+
Host github.com-http-handler
303+
HostName github.com
304+
User git
305+
IdentityFile ~/.ssh/http_handler_key
306+
IdentitiesOnly yes
307+
308+
Host github.com-http-rewriter
309+
HostName github.com
310+
User git
311+
IdentityFile ~/.ssh/http_rewriter_key
312+
IdentitiesOnly yes
313+
EOF
314+
chmod 600 ~/.ssh/config
315+
316+
# Configure git to rewrite URLs to use the correct host alias
317+
git config --global url."ssh://git@github.com-http-handler/platformatic/http-handler".insteadOf "ssh://git@github.com/platformatic/http-handler"
318+
git config --global url."ssh://git@github.com-http-rewriter/platformatic/http-rewriter".insteadOf "ssh://git@github.com/platformatic/http-rewriter"
319+
320+
# Also handle variations without .git suffix
321+
git config --global url."ssh://git@github.com-http-handler/platformatic/http-handler.git".insteadOf "ssh://git@github.com/platformatic/http-handler.git"
322+
git config --global url."ssh://git@github.com-http-rewriter/platformatic/http-rewriter.git".insteadOf "ssh://git@github.com/platformatic/http-rewriter.git"
252323
253324
cargo test --target ${{ matrix.settings.target }}
254325
- name: Test bindings

.github/workflows/lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Lint
22

3+
env:
4+
CARGO_NET_GIT_FETCH_WITH_CLI: 'true'
5+
36
'on':
47
push:
58
branches:

Cargo.lock

Lines changed: 25 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ crate-type = ["cdylib"]
2020
[dependencies]
2121
async-trait = "0.1.88"
2222
bytes = "1.10.1"
23-
http-handler = { git = "ssh://git@github.com/platformatic/http-handler" }
23+
http-handler = { git = "ssh://git@github.com/platformatic/http-handler.git" }
2424
# http-handler = { path = "../http-handler" }
25-
# http-rewriter = { git = "ssh://git@github.com/platformatic/http-rewriter" }
26-
http-rewriter = { path = "../http-rewriter" }
25+
http-rewriter = { git = "ssh://git@github.com/platformatic/http-rewriter.git" }
26+
# http-rewriter = { path = "../http-rewriter" }
2727
# Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
2828
napi = { version = "3.0.0-beta.8", default-features = false, features = ["napi4"], optional = true }
2929
napi-derive = { version = "3.0.0-beta.8", optional = true }

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"main": "index.js",
77
"types": "index.d.ts",
88
"napi": {
9-
"bnaryName": "python-node",
9+
"binaryName": "python-node",
1010
"targets": [
1111
"aarch64-apple-darwin",
1212
"x86_64-apple-darwin",
@@ -28,7 +28,7 @@
2828
"build:debug": "napi build --platform --features napi-support",
2929
"prepublishOnly": "napi prepublish -t npm",
3030
"lint": "oxlint",
31-
"test": "node --test test/**/*.test.mjs",
31+
"test": "node --test test/handler.test.mjs test/concurrency.test.mjs",
3232
"universal": "napi universal",
3333
"version": "napi version"
3434
}

rust-toolchain.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[toolchain]
2+
channel = "stable"
3+
components = [ "rustfmt", "rustc-dev", "clippy" ]
4+
targets = [ "aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu" ]
5+
profile = "minimal"

0 commit comments

Comments
 (0)