|
| 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 | + strategy: |
| 17 | + matrix: |
| 18 | + node-version: [22, 24] |
| 19 | + os: [ubuntu-latest] |
| 20 | + runs-on: ${{matrix.os}} |
| 21 | + timeout-minutes: 10 |
| 22 | + steps: |
| 23 | + - name: Checkout |
| 24 | + uses: actions/checkout@v4 |
| 25 | + - name: Setup SSH Agent |
| 26 | + uses: webfactory/ssh-agent@v0.9.0 |
| 27 | + with: |
| 28 | + ssh-private-key: | |
| 29 | + ${{ secrets.SSH_PRIVATE_KEY }} |
| 30 | + ${{ secrets.HTTP_HANDLER_ACCESS_TOKEN }} |
| 31 | + ${{ secrets.HTTP_REWRITER_ACCESS_TOKEN }} |
| 32 | + - name: Use supported Node.js Version |
| 33 | + uses: actions/setup-node@v4 |
| 34 | + with: |
| 35 | + node-version: ${{ matrix.node-version }} |
| 36 | + - name: Restore cached dependencies |
| 37 | + uses: actions/cache@v4 |
| 38 | + with: |
| 39 | + path: ~/.pnpm-store |
| 40 | + key: node-modules-${{ hashFiles('package.json') }} |
| 41 | + - name: Setup pnpm |
| 42 | + uses: pnpm/action-setup@v4 |
| 43 | + with: |
| 44 | + version: latest |
| 45 | + - name: Set private package config |
| 46 | + run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}" |
| 47 | + env: |
| 48 | + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |
| 49 | + - name: Install dependencies |
| 50 | + run: pnpm install |
| 51 | + # TODO: remove when using published dependency |
| 52 | + - name: Build python-node manually |
| 53 | + run: | |
| 54 | + # Configure git to use SSH host aliases for private repos (needed by cargo) |
| 55 | + git config --global url."ssh://git@github.com-http-handler/platformatic/http-handler".insteadOf "ssh://git@github.com/platformatic/http-handler" |
| 56 | + git config --global url."ssh://git@github.com-http-handler/platformatic/http-handler.git".insteadOf "ssh://git@github.com/platformatic/http-handler.git" |
| 57 | + git config --global url."ssh://git@github.com-http-rewriter/platformatic/http-rewriter".insteadOf "ssh://git@github.com/platformatic/http-rewriter" |
| 58 | + git config --global url."ssh://git@github.com-http-rewriter/platformatic/http-rewriter.git".insteadOf "ssh://git@github.com/platformatic/http-rewriter.git" |
| 59 | +
|
| 60 | + cd node_modules/@platformatic/python-node |
| 61 | + pnpm install --ignore-scripts |
| 62 | + pnpm run build |
| 63 | + - name: Install Python and dependencies |
| 64 | + run: | |
| 65 | + # Ensure Python and dev headers are available |
| 66 | + sudo apt-get update |
| 67 | + sudo apt-get install -y python3 python3-dev python3-pip |
| 68 | + python3 --version |
| 69 | + - name: Run Tests |
| 70 | + run: | |
| 71 | + # Enable verbose Node.js debugging and core dumps |
| 72 | + export NODE_OPTIONS="--trace-warnings --trace-uncaught --trace-exit" |
| 73 | + export DEBUG="platformatic:*" |
| 74 | + ulimit -c unlimited |
| 75 | + |
| 76 | + # Show python-node module info |
| 77 | + echo "Python-node module contents:" |
| 78 | + ls -la node_modules/@platformatic/python-node/ |
| 79 | + |
| 80 | + # Run tests with detailed output |
| 81 | + node --test --test-reporter=spec --test-reporter-destination=stdout |
0 commit comments