Skip to content

chapter2

chapter2 #5

Workflow file for this run

name: Go
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.22.3']
steps:
- uses: actions/checkout@v3
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Test
run: go test -v ./...
working-directory: ./uuid-generator
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
working-directory: ./tinyURL
- name: Run benchmarks
run: go test -bench=. -benchmem ./...
working-directory: ./uuid-generator
- name: Check formatting
run: |
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
echo "The following files are not formatted correctly:"
gofmt -s -l .
exit 1
fi
working-directory: ./uuid-generator