LocalStack Miniflare Extension Tests #119
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: LocalStack Miniflare Extension Tests | |
| on: | |
| schedule: | |
| - cron: '0 2 * * 1-5' | |
| push: | |
| paths: | |
| - .github/workflows/miniflare.yml | |
| - miniflare/** | |
| branches: | |
| - main | |
| pull_request: | |
| paths: | |
| - .github/workflows/miniflare.yml | |
| - miniflare/** | |
| workflow_dispatch: | |
| env: | |
| LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }} | |
| jobs: | |
| tests-miniflare: | |
| name: Run extension tests | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| strategy: | |
| matrix: | |
| tag: | |
| - latest | |
| - dev | |
| env: | |
| IMAGE_NAME: localstack/localstack-pro:${{matrix.tag}} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: true | |
| - name: Install LocalStack and extension | |
| run: | | |
| cd miniflare | |
| docker pull "$IMAGE_NAME" | |
| pip install localstack | |
| make install | |
| make dist | |
| localstack extensions -v install file://"$(ls ./dist/localstack_extension_miniflare-*.tar.gz)" | |
| DEBUG=1 localstack start -d | |
| localstack wait | |
| curl http://localhost:4566/_localstack/health | |
| curl http://localhost:4566/miniflare/user | |
| - name: Run test | |
| env: | |
| CLOUDFLARE_API_TOKEN: test | |
| CLOUDFLARE_API_BASE_URL: "https://localhost.localstack.cloud:4566/miniflare" | |
| run: | | |
| cd miniflare/example | |
| npm install | |
| npm run deploy | |
| curl http://hello.miniflare.localhost.localstack.cloud:4566/test | grep 'Hello World' | |
| - name: Print LocalStack logs | |
| if: always() | |
| run: localstack logs |