Skip to content

fix: distribute agent snapshots to shared-nothing workers #3598

fix: distribute agent snapshots to shared-nothing workers

fix: distribute agent snapshots to shared-nothing workers #3598

Workflow file for this run

name: CI
on:
push:
branches:
- main
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-*"
paths:
- "**.go"
- "go.mod"
- "go.sum"
- "Makefile"
- ".github/workflows/ci.yaml"
pull_request:
# Keep this workflow directly rerunnable from PR-only maintenance commits.
types:
- opened
- reopened # new commits are pushed to the branch that the PR is based on
- synchronize # new commits are pushed to the branch that the PR is based on
- ready_for_review # PR is ready for review
paths:
- "**.go"
- "go.mod"
- "go.sum"
- "Makefile"
- ".github/workflows/ci.yaml"
env:
GO_VERSION: "1.26"
jobs:
# Spell check
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Codespell
uses: codespell-project/actions-codespell@v2
with:
check_hidden: true
skip: ./.git,*.svg,go.mod,go.sum,*.gen.go,pnpm-lock.yaml,*.lock,*.css,.codespellrc,.codespell-ignore-words,CHANGELOG.md
ignore_words_file: .codespell-ignore-words
# Lint Go code
golint:
name: Go Linter
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
- name: Check formatting (go fmt)
run: |
go fmt ./...
# Fail if formatting changed any files
git diff --exit-code || (echo "Go files are not formatted. Please run 'make fmt'" && exit 1)
- name: Check modernize (go fix)
run: |
diff=$(go fix -diff ./... 2>&1) || true
if [ -n "$diff" ]; then
echo "Go files need modernization. Please run 'make fmt'"
echo "$diff"
exit 1
fi
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.9.0
args: --timeout=10m
# Test Go code on multiple platforms
test:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
# - windows-latest
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
- name: Build
if: runner.os != 'Windows'
run: |
make bin
- name: Build (Windows)
if: runner.os == 'Windows'
run: |
go build -o .\.local\bin\dagu.exe .\cmd
- name: Test
if: runner.os != 'Windows'
run: |
make test-coverage
- name: Test (Windows)
if: runner.os == 'Windows'
run: |
go test -v -race .\...
- name: Upload coverage
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v6
with:
files: ./coverage.out
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}