feat(proxy): add token-based rate limiting via response parsing #1249
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: Examples Test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: | |
| - '**/*.md' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| test-examples: | |
| name: Test Examples | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build project | |
| run: npm run build | |
| - name: Install awf globally | |
| run: sudo npm link | |
| - name: Pre-test cleanup | |
| run: sudo ./scripts/ci/cleanup.sh | |
| - name: Make examples executable | |
| run: chmod +x examples/*.sh | |
| - name: Test basic-curl.sh | |
| run: | | |
| echo "=== Testing basic-curl.sh ===" | |
| sudo ./examples/basic-curl.sh | |
| - name: Test using-domains-file.sh | |
| run: | | |
| echo "=== Testing using-domains-file.sh ===" | |
| sudo ./examples/using-domains-file.sh | |
| - name: Test debugging.sh | |
| run: | | |
| echo "=== Testing debugging.sh ===" | |
| sudo ./examples/debugging.sh | |
| - name: Test blocked-domains.sh | |
| run: | | |
| echo "=== Testing blocked-domains.sh ===" | |
| sudo ./examples/blocked-domains.sh | |
| # Note: github-copilot.sh is skipped as it requires GITHUB_TOKEN for Copilot CLI | |
| # To test it, you would need to set up a secret with a valid Copilot token | |
| - name: Post-test cleanup | |
| if: always() | |
| run: sudo ./scripts/ci/cleanup.sh | |
| - name: Upload logs on failure | |
| if: failure() | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: examples-test-logs | |
| path: | | |
| /tmp/*-test.log | |
| /tmp/awf-*/ | |
| /tmp/awf-agent-logs-*/ | |
| /tmp/squid-logs-*/ | |
| retention-days: 7 |