Skip to content

first release

first release #51

Workflow file for this run

name: Run Tests
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- 'releases/**'
env:
CARGO_NET_GIT_FETCH_WITH_CLI: 'true'
GIT_SSH_COMMAND: 'ssh -o UserKnownHostsFile=/github/home/.ssh/known_hosts -o StrictHostKeyChecking=yes'
jobs:
ci:
name: CI - Node.js ${{ matrix.node-version }} & Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
container:
image: python:${{ matrix.python-version }}-slim
options: --user 0
strategy:
matrix:
node-version: [22, 24]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14-rc']
timeout-minutes: 25
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install base packages
run: |
set -euxo pipefail
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gnupg \
git \
openssh-client \
build-essential \
pkg-config \
gdb \
binutils
- name: Setup SSH Agent
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: |
${{ secrets.SSH_PRIVATE_KEY }}
${{ secrets.HTTP_HANDLER_ACCESS_TOKEN }}
${{ secrets.HTTP_REWRITER_ACCESS_TOKEN }}
- name: Trust internal SSH host aliases
run: |
set -e
mkdir -p ~/.ssh
chmod 700 ~/.ssh
touch ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts
KEY_ENTRY=$(ssh-keyscan github.com 2>/dev/null)
echo "$KEY_ENTRY" >> ~/.ssh/known_hosts
echo "$KEY_ENTRY" | sed 's/^github\.com\([[:space:]]\)/github.com-http-handler\1/' >> ~/.ssh/known_hosts
echo "$KEY_ENTRY" | sed 's/^github\.com\([[:space:]]\)/github.com-http-rewriter\1/' >> ~/.ssh/known_hosts
- name: Install Node.js ${{ matrix.node-version }}
env:
NODE_MAJOR: ${{ matrix.node-version }}
run: |
set -euxo pipefail
curl -fsSL "https://deb.nodesource.com/setup_${NODE_MAJOR}.x" | bash -
apt-get install -y --no-install-recommends nodejs
node --version
npm --version
- name: Restore cached dependencies
uses: actions/cache@v4
with:
path: ~/.pnpm-store
key: node-modules-${{ hashFiles('package.json') }}
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest
- name: Set private package config
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Configure Python ${{ matrix.python-version }}
run: |
set -euxo pipefail
python --version
python -m ensurepip --upgrade
python -m pip install --upgrade pip
python -m pip --version
echo "PYO3_PYTHON=$(which python)" >> $GITHUB_ENV
- name: Install dependencies
run: pnpm install
- name: Install Rust toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
# TODO: remove when using published dependency
- name: Build python-node manually
run: |
# Configure git to use SSH host aliases for private repos (needed by cargo)
git config --global url."ssh://git@github.com-http-handler/platformatic/http-handler".insteadOf "ssh://git@github.com/platformatic/http-handler"
git config --global url."ssh://git@github.com-http-handler/platformatic/http-handler.git".insteadOf "ssh://git@github.com/platformatic/http-handler.git"
git config --global url."ssh://git@github.com-http-rewriter/platformatic/http-rewriter".insteadOf "ssh://git@github.com/platformatic/http-rewriter"
git config --global url."ssh://git@github.com-http-rewriter/platformatic/http-rewriter.git".insteadOf "ssh://git@github.com/platformatic/http-rewriter.git"
cd node_modules/@platformatic/python-node
pnpm install --ignore-scripts
pnpm run build
pnpm run build:wasm
pnpm run build:fix
- name: Run Full Test Suite (if isolated test passes)
run: pnpm test