mirror of
https://gitee.com/rulego/streamsql.git
synced 2026-04-18 10:08:28 +00:00
131 lines
3.4 KiB
YAML
131 lines
3.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, master, develop ]
|
|
pull_request:
|
|
branches: [ main, master, develop ]
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
go-version: ['1.19', '1.20', '1.21']
|
|
|
|
steps:
|
|
- name: Set up Go ${{ matrix.go-version }}
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version: ${{ matrix.go-version }}
|
|
|
|
- name: Check out code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Cache Go modules
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-${{ matrix.go-version }}-
|
|
|
|
- name: Download dependencies
|
|
run: go mod download
|
|
|
|
- name: Verify dependencies
|
|
run: go mod verify
|
|
|
|
- name: Build
|
|
run: go build -v ./...
|
|
|
|
- name: Run tests
|
|
run: go test -v -race -timeout 300s ./...
|
|
|
|
- name: Run tests with coverage
|
|
if: matrix.go-version == '1.21'
|
|
run: go test -v -race -coverprofile=coverage.out -covermode=atomic -timeout 300s ./...
|
|
|
|
- name: Upload coverage to Codecov
|
|
if: matrix.go-version == '1.21'
|
|
uses: codecov/codecov-action@v5
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
case-expression-tests:
|
|
name: CASE Expression Tests
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version: '1.21'
|
|
|
|
- name: Check out code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Cache Go modules
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: ${{ runner.os }}-go-1.21-${{ hashFiles('**/go.sum') }}
|
|
|
|
- name: Download dependencies
|
|
run: go mod download
|
|
|
|
- name: Run CASE Expression Parsing Tests
|
|
run: go test -v -run TestCaseExpressionParsing -timeout 15s
|
|
|
|
- name: Run CASE Expression Comprehensive Tests
|
|
run: go test -v -run TestCaseExpressionComprehensive -timeout 15s
|
|
|
|
- name: Run CASE Expression Field Extraction Tests
|
|
run: go test -v -run TestCaseExpressionFieldExtraction -timeout 15s
|
|
|
|
- name: Run CASE Expression in SQL Tests
|
|
run: go test -v -run TestCaseExpressionInSQL -timeout 15s
|
|
|
|
- name: Run CASE Expression Aggregation Tests (with known limitations)
|
|
run: go test -v -run "TestCaseExpressionInAggregation|TestComplexCaseExpressionsInAggregation" -timeout 20s
|
|
|
|
- name: Run CASE Expression Edge Cases
|
|
run: go test -v -run TestCaseExpressionEdgeCases -timeout 15s
|
|
|
|
# lint:
|
|
# name: Lint
|
|
# runs-on: ubuntu-latest
|
|
#
|
|
# steps:
|
|
# - name: Set up Go
|
|
# uses: actions/setup-go@v4
|
|
# with:
|
|
# go-version: '1.21'
|
|
#
|
|
# - name: Check out code
|
|
# uses: actions/checkout@v4
|
|
#
|
|
# - name: Run golangci-lint
|
|
# uses: golangci/golangci-lint-action@v3
|
|
# with:
|
|
# version: latest
|
|
# args: --timeout=5m
|
|
#
|
|
# security:
|
|
# name: Security Scan
|
|
# runs-on: ubuntu-latest
|
|
#
|
|
# steps:
|
|
# - name: Set up Go
|
|
# uses: actions/setup-go@v4
|
|
# with:
|
|
# go-version: '1.21'
|
|
#
|
|
# - name: Check out code
|
|
# uses: actions/checkout@v4
|
|
#
|
|
# - name: Run Gosec Security Scanner
|
|
# uses: securecodewarrior/github-action-gosec@v1
|
|
# with:
|
|
# args: './...' |