12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- name: Run Tests
- on:
- pull_request:
- branches:
- - main
- push:
- branches:
- - main
- concurrency:
- group: test-${{ github.head_ref || github.run_id }}
- cancel-in-progress: true
-
- jobs:
- test:
- runs-on: ubuntu-latest
- services:
- redis:
- image: redis
- ports:
- - 6379:6379
- options: -e REDIS_PASSWORD=difyai123456
- postgres:
- image: postgres
- env:
- POSTGRES_USER: postgres
- POSTGRES_PASSWORD: difyai123456
- POSTGRES_DB: difyai
- ports:
- - 5432:5432
- steps:
- - uses: actions/checkout@v2
- - name: Setup Golang 1.21.6
- uses: actions/setup-go@v5
- with:
- go-version: '1.21.6'
- - name: Setup License
- run: go run cmd/license/generate/main.go
- - name: Install dependencies
- run: go mod download
- - name: Run tests
- run: go test -v ./...
|