|
| 1 | +name: Run Tests |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + pull_request: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - main |
| 9 | + - 'releases/**' |
| 10 | + |
| 11 | +env: |
| 12 | + CARGO_NET_GIT_FETCH_WITH_CLI: 'true' |
| 13 | + |
| 14 | +jobs: |
| 15 | + ci: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + container: |
| 18 | + image: node:${{ matrix.node-version }}-bookworm |
| 19 | + options: --user 0 |
| 20 | + strategy: |
| 21 | + matrix: |
| 22 | + node-version: [22, 24] |
| 23 | + timeout-minutes: 10 |
| 24 | + steps: |
| 25 | + - name: Checkout |
| 26 | + uses: actions/checkout@v4 |
| 27 | + - name: Setup SSH Agent |
| 28 | + uses: webfactory/ssh-agent@v0.9.0 |
| 29 | + with: |
| 30 | + ssh-private-key: | |
| 31 | + ${{ secrets.SSH_PRIVATE_KEY }} |
| 32 | + ${{ secrets.HTTP_HANDLER_ACCESS_TOKEN }} |
| 33 | + ${{ secrets.HTTP_REWRITER_ACCESS_TOKEN }} |
| 34 | + - name: Restore cached dependencies |
| 35 | + uses: actions/cache@v4 |
| 36 | + with: |
| 37 | + path: ~/.pnpm-store |
| 38 | + key: node-modules-${{ hashFiles('package.json') }} |
| 39 | + - name: Setup pnpm |
| 40 | + uses: pnpm/action-setup@v4 |
| 41 | + with: |
| 42 | + version: latest |
| 43 | + - name: Set private package config |
| 44 | + run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}" |
| 45 | + env: |
| 46 | + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |
| 47 | + - name: Install dependencies |
| 48 | + run: pnpm install |
| 49 | + - name: Install Python and dependencies |
| 50 | + run: | |
| 51 | + # Ensure Python and dev headers are available |
| 52 | + apt-get update |
| 53 | + apt-get install -y python3 python3-dev python3-pip gdb binutils git openssh-client |
| 54 | + python3 --version |
| 55 | + # TODO: remove when using published dependency |
| 56 | + - name: Build python-node manually |
| 57 | + run: | |
| 58 | + # Configure git to use SSH host aliases for private repos (needed by cargo) |
| 59 | + git config --global url."ssh://git@github.com-http-handler/platformatic/http-handler".insteadOf "ssh://git@github.com/platformatic/http-handler" |
| 60 | + git config --global url."ssh://git@github.com-http-handler/platformatic/http-handler.git".insteadOf "ssh://git@github.com/platformatic/http-handler.git" |
| 61 | + git config --global url."ssh://git@github.com-http-rewriter/platformatic/http-rewriter".insteadOf "ssh://git@github.com/platformatic/http-rewriter" |
| 62 | + git config --global url."ssh://git@github.com-http-rewriter/platformatic/http-rewriter.git".insteadOf "ssh://git@github.com/platformatic/http-rewriter.git" |
| 63 | +
|
| 64 | + cd node_modules/@platformatic/python-node |
| 65 | + pnpm install --ignore-scripts |
| 66 | + pnpm run build |
| 67 | + pnpm run build:wasm |
| 68 | + pnpm run build:fix |
| 69 | + - name: Run Full Test Suite (if isolated test passes) |
| 70 | + run: pnpm test |
0 commit comments