mirror of
https://github.com/sot-tech/mochi.git
synced 2026-04-26 23:50:00 -07:00
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
93 lines
2.9 KiB
YAML
93 lines
2.9 KiB
YAML
---
|
|
name: "Build & Test"
|
|
on:
|
|
push:
|
|
branches:
|
|
- "!dependabot/*"
|
|
- "master"
|
|
pull_request:
|
|
branches: [ "*" ]
|
|
jobs:
|
|
build:
|
|
name: "Go Build"
|
|
runs-on: "ubuntu-latest"
|
|
steps:
|
|
- uses: "actions/checkout@v3"
|
|
- uses: "actions/setup-go@v4"
|
|
with:
|
|
go-version: ">=1.19"
|
|
- name: "Build"
|
|
run: "go build ./cmd/..."
|
|
|
|
unit:
|
|
name: "Run Unit Tests"
|
|
runs-on: "ubuntu-latest"
|
|
services:
|
|
redis:
|
|
image: "eqalpha/keydb"
|
|
ports: [ "6379:6379" ]
|
|
postgres:
|
|
image: "postgres:latest"
|
|
env:
|
|
POSTGRES_DB: test
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_HOST_AUTH_METHOD: trust
|
|
ports: [ "5432:5432" ]
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
steps:
|
|
- uses: "actions/checkout@v3"
|
|
- uses: "actions/setup-go@v4"
|
|
with:
|
|
go-version: "^1.19"
|
|
- name: "Run `go test`"
|
|
run: "go test -race ./..."
|
|
|
|
e2e-mem:
|
|
name: "E2E Memory Tests"
|
|
runs-on: "ubuntu-latest"
|
|
steps:
|
|
- uses: "actions/checkout@v3"
|
|
- uses: "actions/setup-go@v4"
|
|
with:
|
|
go-version: "^1.19"
|
|
- name: "Install and configure mochi"
|
|
run: |
|
|
go install ./cmd/mochi
|
|
go install ./cmd/mochi-e2e
|
|
cat ./dist/example_config.yaml
|
|
- name: "Run end-to-end tests"
|
|
run: |
|
|
mochi --config=./dist/example_config.yaml --logLevel debug --logPretty &
|
|
pid=$!
|
|
sleep 2
|
|
mochi-e2e
|
|
kill $pid
|
|
e2e-redis:
|
|
name: "E2E Redis Tests"
|
|
runs-on: "ubuntu-latest"
|
|
services:
|
|
redis:
|
|
image: "eqalpha/keydb"
|
|
ports: [ "6379:6379" ]
|
|
steps:
|
|
- uses: "actions/checkout@v3"
|
|
- uses: "actions/setup-go@v4"
|
|
with:
|
|
go-version: "^1.19"
|
|
- name: "Install and configure mochi"
|
|
run: |
|
|
go install ./cmd/mochi
|
|
go install ./cmd/mochi-e2e
|
|
cat ./dist/example_config_redis.yaml
|
|
- name: "Run end-to-end tests"
|
|
run: |
|
|
mochi --config=./dist/example_config_redis.yaml --logLevel debug --logPretty &
|
|
pid=$!
|
|
sleep 2
|
|
mochi-e2e
|
|
kill $pid
|