github.com/gobuffalo/buffalo-cli/v2@v2.0.0-alpha.15.0.20200919213536-a7350c8e6799/cli/internal/plugins/ci/templates/github.yml.tmpl (about) 1 name: Tests 2 on: 3 push: 4 branches: 5 - master 6 pull_request: 7 8 jobs: 9 Test: 10 name: Tests 11 runs-on: ubuntu-latest 12 services: 13 {{- if eq .Database "postgres" }} 14 postgres: 15 image: postgres:10.8 16 ports: 17 - 5432:5432 18 options: >- 19 --health-cmd pg_isready 20 --health-interval 10s 21 --health-timeout 5s 22 --health-retries 5 23 env: 24 POSTGRES_PASSWORD: postgres 25 POSTGRES_USER: postgres 26 {{- end}} 27 steps: 28 29 - name: Set up Go 1.14 30 uses: actions/setup-go@v1 31 with: 32 go-version: 1.14 33 id: go 34 - uses: actions/checkout@v2 35 - uses: actions/cache@v1 36 with: 37 path: ~/go/pkg/mod 38 key: {{"${{ runner.os }}"}}-go-{{"${{ hashFiles('go.sum') }}"}} 39 restore-keys: | 40 {{"${{ runner.os }}"}}-go 41 42 - name: Buffalo Tests 43 env: 44 GOPROXY: "https://proxy.golang.org" 45 GO111MODULE: "on" 46 {{- if eq .Database "postgres" }} 47 TEST_DATABASE_URL: "postgres://postgres:postgres@127.0.0.1:{{"${{ job.services.postgres.ports[5432] }}"}}/{{.Name}}_test?sslmode=disable" 48 {{- end}} 49 run: | 50 go get github.com/gobuffalo/buffalo-cli/v2/cmd/buffalo@latest 51 buffalo test -v ./...