Skip to content

refactor: docker test #1407

refactor: docker test

refactor: docker test #1407

Workflow file for this run

name: Test
on:
push:
branches:
- master
pull_request:
env:
MAIL_HOST: ${{ secrets.MAIL_HOST }}
MAIL_USERNAME: ${{ secrets.MAIL_USERNAME }}
MAIL_PASSWORD: ${{ secrets.MAIL_PASSWORD }}
MAIL_FROM_ADDRESS: ${{ secrets.MAIL_FROM_ADDRESS }}
MAIL_FROM_NAME: ${{ secrets.MAIL_FROM_NAME }}
MAIL_TO: ${{ secrets.MAIL_TO }}
MAIL_CC: ${{ secrets.MAIL_CC }}
MAIL_BCC: ${{ secrets.MAIL_BCC }}
jobs:
linux:
strategy:
matrix:
go:
- "stable"
- "oldstable"
runs-on: ubuntu-latest
services:
mysql:
image: mysql:latest
env:
MYSQL_DATABASE: goravel
MYSQL_ROOT_PASSWORD: Goravel(!)
ports:
- 3306:3306
postgresql:
image: postgres:latest
env:
TZ: Asia/Shanghai
POSTGRES_USER: root
POSTGRES_PASSWORD: Goravel(!)
ports:
- 5432:5432
sqlserver:
image: mcr.microsoft.com/mssql/server:latest
env:
ACCEPT_EULA: Y
MSSQL_SA_PASSWORD: Goravel(!)
ports:
- 1433:1433
redis:
image: redis:latest
ports:
- 6379:6379
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: Install dependencies
run: go mod tidy
- name: Run tests with coverage
run: go test -v -coverprofile="coverage.out" ./...
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.out
token: ${{ secrets.CODECOV }}
windows:
strategy:
matrix:
go:
- "stable"
- "oldstable"
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: Install dependencies
run: go mod tidy
- name: Run tests
run: go test ./... -short