Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
lint:
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.22'
- name: Run linter
uses: golangci/golangci-lint-action@v9
with:
version: v2.6
- name: Run go vet
run: go vet ./...
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@v0.6.1
- name: Run staticcheck
run: staticcheck ./...

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.22'
- name: Verify go modules
run: |
go mod tidy
go mod verify
- name: Build binaries
run: go build -v ./...
- name: Run unit tests with coverage
run: go test -v -coverprofile=coverage.out ./...
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage.out

integration-test:
runs-on: ubuntu-latest
env:
SCIMA_TEST_ROOT_DIR: ${{ github.workspace }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Verify go modules
run: |
go mod tidy
go mod verify
- name: Build binaries
run: go build -v ./...
- name: Run integration tests
run: go test -v --tags=integration ./tests/integration/...
2 changes: 1 addition & 1 deletion tests/integration/postgres/postgres_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestPostgresMigrationsIntegration(t *testing.T) {
// ---------------------------------------------------------------------
ctx := context.Background()

rootDir := "/Users/I758791/github.com/scima"
rootDir := getenvDefault("SCIMA_TEST_ROOT_DIR", "/Users/I758791/github.com/scima")
migDir := filepath.Join(rootDir, "tests", "integration", "postgres", "migrations")
if _, err := os.Stat(migDir); os.IsNotExist(err) {
t.Fatalf("migrations folder not found: %s", migDir)
Expand Down