name: Tests on: push: branches-ignore: - 'tmp-*' pull_request: branches-ignore: - 'tmp-*' jobs: tests: name: CI runs-on: ubuntu-latest services: mysql: image: 'mysql:5.7' env: MYSQL_ALLOW_EMPTY_PASSWORD: 1 volumes: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro ports: - 3306:3306 redis: image: 'redis' volumes: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro ports: - 6379:6379 postgres: image: 'yedf/postgres-xa' volumes: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro env: POSTGRES_PASSWORD: mysecretpassword POSTGRES_DB: dtm ports: - '5432:5432' mongo: image: 'yedf/mongo-rs' volumes: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro ports: - 27017:27017 steps: - name: Set up Go 1.18 uses: actions/setup-go@v2 with: go-version: '1.18' - name: Check out code uses: actions/checkout@v2 - name: Install dependencies run: | go mod download - name: Run CI lint run: sh helper/golint.sh - name: Run test cover run: sh helper/test-cover.sh - name: Upload to codecov uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: ./coverage.txt # optional fail_ci_if_error: true # optional (default = false) verbose: true # optional (default = false)