sync from main #201
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
# This workflow will build a golang project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
name: Go | |
on: | |
push: | |
branches: [ "r1.0" ] | |
pull_request: | |
branches: [ "r1.0" ] | |
jobs: | |
go20_redis7_mysql8: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build and start containers | |
run: docker compose -f tests/environments/go1.20_redis7_mysql8/docker-compose.yml up -d --build && docker ps | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.20" | |
check-latest: true | |
- name: Build | |
run: go mod tidy && go build -v ./... | |
- name: Test | |
run: | | |
go test -race -cover -v ./... -coverprofile coverage.txt -coverpkg ./... | |
go tool cover -func=coverage.txt -o=coverage.out | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./coverage.txt | |
- name: Benchmark | |
run: go test -race -v ./... -bench . -run ^$ -count 10 -benchmem | |
- name: Stop containers | |
if: always() | |
run: docker compose -f tests/environments/go1.20_redis7_mysql8/docker-compose.yml down | |
go21_redis7_mysql8: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build and start containers | |
run: docker compose -f tests/environments/go1.21_redis7_mysql8/docker-compose.yml up -d --build && docker ps | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.21" | |
check-latest: true | |
- name: Build | |
run: go mod tidy && go build -v ./... | |
- name: Test | |
run: go test -race -v ./... | |
- name: Benchmark | |
run: go test -race -v ./... -bench . -run ^$ -count 10 -benchmem | |
- name: Stop containers | |
if: always() | |
run: docker compose -f tests/environments/go1.21_redis7_mysql8/docker-compose.yml down | |
go22_redis7_mysql8: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build and start containers | |
run: docker compose -f tests/environments/go1.22_redis7_mysql8/docker-compose.yml up -d --build && docker ps | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.22" | |
check-latest: true | |
- name: Build | |
run: go mod tidy && go build -v ./... | |
- name: Test | |
run: go test -race -v ./... | |
- name: Benchmark | |
run: go test -race -v ./... -bench . -run ^$ -count 10 -benchmem | |
- name: Stop containers | |
if: always() | |
run: docker compose -f tests/environments/go1.22_redis7_mysql8/docker-compose.yml down | |
go23_redis7_mysql8: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build and start containers | |
run: docker compose -f tests/environments/go1.23_redis7_mysql8/docker-compose.yml up -d --build && docker ps | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.23" | |
check-latest: true | |
- name: Build | |
run: go mod tidy && go build -v ./... | |
- name: Test | |
run: go test -race -v ./... | |
- name: Benchmark | |
run: go test -race -v ./... -bench . -run ^$ -count 10 -benchmem | |
- name: Stop containers | |
if: always() | |
run: docker compose -f tests/environments/go1.23_redis7_mysql8/docker-compose.yml down |