Skip to content

feat/mouse movements #5763

feat/mouse movements

feat/mouse movements #5763

Workflow file for this run

# Run tests for js packages
name: tests
on:
pull_request:
branches: [main, dev, staging, release/*]
types:
- opened # when a PR is opened
- synchronize # when a PR is pushed to
- reopened # when a PR is reopened
- ready_for_review # when a PR is marked as ready for review (e.g. taken off draft mode)
workflow_dispatch:
permissions:
contents: read
pull-requests: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
GITHUB_TOKEN: ${{ secrets.PROSOPONATOR_PAT }}
GH_TOKEN: ${{ secrets.PROSOPONATOR_PAT }}
CARGO_TERM_COLOR: always
NODE_OPTIONS: "--max-old-space-size=4096"
NODE_ENV: "test"
defaults:
run:
shell: bash
jobs:
check:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- name: Print contexts
uses: prosopo/captcha/.github/actions/print_contexts@gha
with:
INPUTS_CONTEXT: ${{ toJson(inputs) }}
NEEDS_CONTEXT: ${{ toJson(needs) }}
VARS_CONTEXT: ${{ toJson(vars) }}
SECRETS_CONTEXT: ${{ toJson(secrets) }}
- name: Set NX_PARALLEL environment variable
run: echo "NX_PARALLEL=$(nproc)" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: actions/setup-node@v4
with:
node-version: '24'
cache: 'npm'
- uses: prosopo/captcha/.github/actions/npm@gha
with:
npm_ci_args: '--include=dev'
- name: env
run: |
# Copy the rococo env file to production env file
echo "Copying the rococo env to production env file in procaptcha-bundle"
cp ./dev/scripts/env.production ./packages/procaptcha-bundle/.env.production
# build all packages in workspace
- run: npx turbo run build
- run: npx turbo run build:cjs
# bundle procaptcha-bundle using webpack
- name: Webpack Bundle procaptcha-bundle
run: |
NODE_ENV="development" npx turbo run @prosopo/procaptcha-bundle#bundle:webpack
- name: Start the docker images
run: |
docker compose --file ./docker/docker-compose.test.yml up -d --remove-orphans --force-recreate --always-recreate-deps
docker container ls
sleep 10s
- name: Setup env
run: |
set -euxo pipefail # stop on errors, print commands, fail on pipe fails
cp demos/client-example-server/env.development demos/client-example-server/.env.test
cp demos/client-bundle-example/env.development demos/client-bundle-example/.env.test
cp dev/scripts/env.test .env.test
cp dev/scripts/env.test dev/scripts/.env.test
cp dev/scripts/env.test packages/cli/.env.test
cp dev/scripts/env.test packages/procaptcha-bundle/.env.test
NODE_ENV="test" npm run setup
echo NODE_ENV: "$NODE_ENV"
- name: Start services and run tests
env:
NX_PARALLEL: "1"
run: |
npx concurrently \
"NODE_ENV=test npm run start:provider" \
"sleep 10s && NODE_ENV=test npm run test:all" \
--success "first" --kill-others
- run: docker compose --file ./docker/docker-compose.test.yml down