Add L402 payment middleware for transparent 402 handling #32
Workflow file for this run
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: tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| unit: | |
| name: Run unit tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set up Go | |
| uses: actions/setup-go@v3 | |
| with: | |
| go-version: '1.21' # Use the Go version your project requires | |
| - name: Check out code | |
| uses: actions/checkout@v3 | |
| - name: Cache Go Modules | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/go/pkg/mod | |
| ~/.cache/go-build | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go- | |
| - name: Get dependencies | |
| run: go mod download | |
| - name: Run tests | |
| run: go test ./... -v | |
| e2e: | |
| name: Run E2E Tests | |
| runs-on: ubuntu-latest | |
| needs: unit | |
| services: | |
| docker: | |
| image: docker:19.03.12 | |
| options: --privileged | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Cache Go Modules | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/go/pkg/mod | |
| ~/.cache/go-build | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go- | |
| - uses: actions/setup-go@v3 | |
| with: | |
| go-version: '1.21' | |
| - name: Set up Docker Compose | |
| run: | | |
| sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
| sudo chmod +x /usr/local/bin/docker-compose | |
| docker-compose version | |
| - name: Start Docker Compose environment | |
| run: docker-compose -f ./tools/e2e-env/docker-compose.yml up -d | |
| - name: Run E2E Tests with Docker Compose | |
| run: docker-compose -f ./tools/e2e-env/docker-compose.yml run --build e2e-tests | |
| env: | |
| ALBY_BEARER_TOKEN: ${{ secrets.ALBY_BEARER_TOKEN }} | |
| - name: Cleanup Docker Compose | |
| if: always() | |
| run: docker-compose -f ./tools/e2e-env/docker-compose.yml down |