Merge pull request #1 from koofr/feature-ci #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
tags: | |
- v* | |
branches: | |
- master | |
pull_request: | |
name: Test | |
jobs: | |
test: | |
strategy: | |
matrix: | |
go-version: [1.21.x, 1.22.x] | |
platform: [ubuntu-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Install redis | |
run: sudo apt-get install -y redis-tools redis-server | |
- name: Verify that redis is up | |
run: redis-cli ping | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Get dependencies | |
run: go get ./... | |
- name: Test | |
run: | | |
REDIS_HOST=localhost REDIS_PORT=6379 go test -v ./... |