Skip to content

testing

testing #67

Workflow file for this run

name: Build and Test
on:
push:
branches: [ 'main', 'feat/**' ]
paths-ignore:
- '**.md' # Don't run CI on markdown changes.
pull_request:
branches: [ 'main', 'feat/**' ]
paths-ignore:
- '**.md'
jobs:
go-mod-tidy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Go mod tidy
run: |
go mod tidy
git diff --exit-code -- go.mod go.sum
go-versions:
uses: ./.github/workflows/go-versions.yml
# Runs the common tasks (unit tests, lint, contract tests) for each Go version.
test-linux:
name: ${{ format('Linux, Go {0}', matrix.go-version) }}
needs: go-versions
strategy:
# Let jobs fail independently, in case it's a single version that's broken.
fail-fast: false
matrix:
go-version: ${{ fromJSON(needs.go-versions.outputs.matrix) }}
uses: ./.github/workflows/common_ci.yml
with:
go-version: ${{ matrix.go-version }}
test-linux-redis-cluster:
name: ${{ format('Linux, Go {0} with Redis Cluster', matrix.go-version) }}
runs-on: ubuntu-latest
env:
LD_TEST_REDIS_ADDRESSES: redis-node1:6379 redis-node2:6379 redis-node3:6379
needs: go-versions
strategy:
fail-fast: false
matrix:
go-version: ${{ fromJSON(needs.go-versions.outputs.matrix) }}
services:
redis-node1:
image: bitnami/redis-cluster:latest
env:
ALLOW_EMPTY_PASSWORD: yes
REDIS_NODES: redis-node1 redis-node2 redis-node3
REDIS_CLUSTER_REPLICAS: 0
redis-node2:
image: bitnami/redis-cluster:latest
env:
ALLOW_EMPTY_PASSWORD: yes
REDIS_NODES: redis-node1 redis-node2 redis-node3
REDIS_CLUSTER_REPLICAS: 0
redis-node3:
image: bitnami/redis-cluster:latest
env:
ALLOW_EMPTY_PASSWORD: yes
REDIS_NODES: redis-node1 redis-node2 redis-node3
REDIS_CLUSTER_REPLICAS: 0
redis-cluster-init:
image: bitnami/redis-cluster:latest
env:
ALLOW_EMPTY_PASSWORD: yes
REDIS_CLUSTER_CREATOR: yes
REDIS_NODES: redis-node1 redis-node2 redis-node3
REDIS_CLUSTER_REPLICAS: 0
container:
image: ubuntu:22.04
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Deps
run: |
apt-get update
apt-get install -y make curl gcc
- uses: ./.github/actions/unit-tests
with:
upload-results: 'false'
test-windows:
name: ${{ format('Windows, Go {0}', matrix.go-version) }}
runs-on: windows-2022
needs: go-versions
strategy:
fail-fast: false
matrix:
go-version: ${{ fromJSON(needs.go-versions.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- uses: launchdarkly/gh-actions/persistent-stores@e6c252c68cdfa04728aef3935c9b8b1a6a6d7bbc
with:
redis: true
consul: true
dynamodb: true
- name: Test
run: go test -count=1 -race ./...
test-macos:
runs-on: macos-latest
steps:
- uses: launchdarkly/gh-actions/persistent-stores@e6c252c68cdfa04728aef3935c9b8b1a6a6d7bbc
with:
redis: true
consul: true
dynamodb: true