Address CodeRabbit: InvalidCause unwrap and table-driven error tests #111
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: Go | |
| on: [push] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: 1.26 | |
| id: go | |
| - name: Check out code into the Go module directory | |
| uses: actions/checkout@v7 | |
| with: | |
| persist-credentials: false | |
| - name: Stripe legacy API guard | |
| run: | | |
| status=0 | |
| matches=$(grep -RnE --include='*.go' --exclude-dir=vendor 'stripe[A-Za-z0-9_]*\.Key\b|stripe-go/v82/(paymentintent|customer)\b' .) || status=$? | |
| if [ "$status" -gt 1 ]; then | |
| echo "Unable to scan Go sources for legacy stripe-go API usage" | |
| exit 1 | |
| fi | |
| if [ -n "$matches" ]; then | |
| echo "Legacy stripe-go API usage found: use stripe.Client via appconfig.GetStripeClientByCurrency" | |
| echo "$matches" | |
| exit 1 | |
| fi | |
| - name: Swagger - Installation | |
| run: go install github.com/swaggo/swag/cmd/swag@latest | |
| - name: Swagger - Init | |
| run: ~/go/bin/swag init | |
| - name: Get dependencies | |
| run: | | |
| go get -v -t -d ./... | |
| if [ -f Gopkg.toml ]; then | |
| curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | |
| dep ensure | |
| fi | |
| - name: Config | |
| run: | | |
| cp config.json.dist config.json | |
| sed -i 's/pk_xxx/${{ secrets.STRIPE_PK }}/g; s/sk_xxx/${{ secrets.STRIPE_SK }}/g' config.json | |
| - name: Build | |
| run: go build -v . | |
| - name: Tests - Unit | |
| run: go test ./... -failfast -tags=unit | |
| - name: Tests - Stripe | |
| run: go test ./... -failfast -tags=stripe -config=/home/runner/work/upaygo/upaygo/config.json |