feat(ci): add CI pipeline with linting, building, and testing jobs
This commit is contained in:
parent
5736edd07a
commit
9d0565de62
1 changed files with 435 additions and 0 deletions
74
.github/workflows/integration-tests.yml
vendored
Normal file
74
.github/workflows/integration-tests.yml
vendored
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
name: Integration Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, develop ]
|
||||
pull_request:
|
||||
branches: [ main, develop ]
|
||||
|
||||
jobs:
|
||||
integration-tests:
|
||||
name: Run Integration Tests
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: ['1.23.x']
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
|
||||
- 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: Set up test environment
|
||||
run: |
|
||||
# Create any necessary directories for test data
|
||||
mkdir -p /tmp/test-data
|
||||
|
||||
- name: Run integration tests
|
||||
run: |
|
||||
# Run integration tests using the existing script
|
||||
chmod +x ./integrationtests/run_tests.sh
|
||||
./integrationtests/run_tests.sh
|
||||
|
||||
- name: Run integration tests with coverage
|
||||
run: |
|
||||
# Also run integration tests with Go test for coverage
|
||||
go test -v -race -coverprofile=integration-coverage.out -covermode=atomic ./integrationtests/...
|
||||
|
||||
- name: Generate integration test coverage report
|
||||
run: go tool cover -html=integration-coverage.out -o integration-coverage.html
|
||||
|
||||
- name: Upload integration coverage to Codecov
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
file: ./integration-coverage.out
|
||||
flags: integrationtests
|
||||
name: codecov-integration
|
||||
fail_ci_if_error: false
|
||||
|
||||
- name: Upload integration coverage artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: integration-coverage-report
|
||||
path: integration-coverage.html
|
||||
Loading…
Reference in a new issue