feat: add API npm integration test using published deathbycaptcha-lib… #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: API Integration | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| api_integration: | |
| name: API basic integration | |
| runs-on: ubuntu-latest | |
| env: | |
| MOZ_HEADLESS: '1' | |
| DBC_USERNAME: ${{ secrets.DBC_USERNAME }} | |
| DBC_PASSWORD: ${{ secrets.DBC_PASSWORD }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - name: Cache npm | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-node-24-npm-${{ hashFiles('package.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node-24-npm- | |
| - name: Show versions | |
| run: | | |
| node --version | |
| npm --version | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Skip integration test when secrets are missing | |
| if: ${{ env.DBC_USERNAME == '' || env.DBC_PASSWORD == '' }} | |
| run: | | |
| echo "DBC_USERNAME and/or DBC_PASSWORD secrets are not configured. Skipping API integration test." | tee -a "$GITHUB_STEP_SUMMARY" | |
| - name: Run API integration test | |
| if: ${{ env.DBC_USERNAME != '' && env.DBC_PASSWORD != '' }} | |
| run: npm run test:integration:api |