Merge pull request #1 from modelcontextprotocol/chore/scaffolding
Initial project structure for MCP variants
This commit is contained in:
parent
4c989fd9f6
commit
4f98e0aab3
1 changed files with 855 additions and 3 deletions
80
.github/workflows/go.yml
vendored
Normal file
80
.github/workflows/go.yml
vendored
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
name: Go CI
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- 'go/**'
|
||||
- '.github/workflows/go.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'go/**'
|
||||
- '.github/workflows/go.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
go-lint:
|
||||
name: "Linting"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||
with:
|
||||
go-version: "^1.25"
|
||||
- name: Check formatting
|
||||
run: |
|
||||
cd go/sdk
|
||||
unformatted=$(gofmt -l .)
|
||||
if [ -n "$unformatted" ]; then
|
||||
echo "The following files are not properly formatted:"
|
||||
echo "$unformatted"
|
||||
exit 1
|
||||
fi
|
||||
echo "All Go files are properly formatted"
|
||||
- name: Run Go vet
|
||||
run: |
|
||||
cd go/sdk
|
||||
go vet ./...
|
||||
- name: Run staticcheck
|
||||
uses: dominikh/staticcheck-action@288b4e28bae83c59f35f73651aeb5cab746a06fc # v1.4.0
|
||||
with:
|
||||
install-go: false
|
||||
version: "v0.6.1"
|
||||
working-directory: go/sdk
|
||||
|
||||
go-test:
|
||||
name: "Unit Tests"
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go: ["1.23", "1.24", "1.25"]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
- name: Test
|
||||
run: |
|
||||
cd go/sdk
|
||||
go test -v ./...
|
||||
|
||||
go-race-test:
|
||||
name: "Race Detection"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
||||
with:
|
||||
go-version: "1.24"
|
||||
- name: Test with -race
|
||||
run: |
|
||||
cd go/sdk
|
||||
go test -v -race ./...
|
||||
Loading…
Reference in a new issue