Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
keelerm84 committed Oct 25, 2024
1 parent 75f7a1b commit 28c077e
Showing 1 changed file with 93 additions and 86 deletions.
179 changes: 93 additions & 86 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,89 +10,89 @@ on:
- '**.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-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'
# # 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'



Expand All @@ -111,13 +111,20 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Install Redis
shell: powershell
# The process needs to be started with Start-Process, which creates a new process independent
# of this shell. That way it can run in the background when we move on to the Go test step.
run: |
choco install redis
Start-Process redis-server
- uses: launchdarkly/gh-actions/actions/persistent-stores@186e7fe1a89be670dbd30c70dd16faae9f07d9b3
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/actions/persistent-stores@186e7fe1a89be670dbd30c70dd16faae9f07d9b3
with:
redis: true
consul: true
dynamodb: true

0 comments on commit 28c077e

Please sign in to comment.