Skip to content

Update github-release.yml #2

Update github-release.yml

Update github-release.yml #2

Workflow file for this run

name: Lint Test Build
on:
push:
branches:
- main
- staging
pull_request:
branches:
- main
- staging
jobs:
lint:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Install golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.54.2
golangci-lint version
- name: Run golangci-lint
run: golangci-lint run --timeout=5m
test:
name: Testing
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Install dependencies
run: go mod tidy
- name: Run tests
run: go test ./... -v
build:
name: Building
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Install dependencies
run: go mod tidy
- name: Build the project
run: go build -o gocrab main.go
- name: Verify binary exists
run: |
if [ ! -f "./gocrab" ]; then
echo "Build failed: binary not found."
exit 1
fi