Skip to content

Traslate code & comments #8

Traslate code & comments

Traslate code & comments #8

Workflow file for this run

name: CI
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download dependencies
run: go mod download
- name: Verify dependencies
run: go mod verify
- name: Run go vet
run: go vet ./...
- name: Run go fmt check
run: |
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
echo "Code is not formatted properly:"
gofmt -s -l .
exit 1
fi
- name: Build
run: go build -v ./...
- name: Test build for multiple platforms
run: |
GOOS=linux GOARCH=amd64 go build -o /tmp/coderun-linux-amd64 .
GOOS=darwin GOARCH=amd64 go build -o /tmp/coderun-darwin-amd64 .
GOOS=windows GOARCH=amd64 go build -o /tmp/coderun-windows-amd64.exe .
echo "✅ Multi-platform build successful"