docs: update example on readme to use GetAs function #17
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
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 ./... |