Skip to content

Merge pull request #3 from ruslanSorokin/main #16

Merge pull request #3 from ruslanSorokin/main

Merge pull request #3 from ruslanSorokin/main #16

name: 'Version and Test'
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
version-and-test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0.32
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test
MYSQL_USER: user
MYSQL_PASSWORD: user
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=12
steps:
- name: Wait MySQL
run: until mysql -h'127.0.0.1' -uuser -puser test -e ";" ; do sleep 5; done
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.x'
preferLatestVersion: true
- name: Determine Version
uses: gittools/actions/gitversion/execute@v0
with:
useConfigFile: true
- name: Show Version
run: echo $GITVERSION_SEMVER
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Test
run: go test -v ./...