fix: correct MSSQL password in test schema to match service configura… #52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build & Test | |
| on: | |
| push: | |
| branches: [ trunk, develop ] | |
| tags: | |
| - 'v*' | |
| paths-ignore: | |
| - '**.md' | |
| - 'docs/**' | |
| - 'LICENSE' | |
| - 'CHANGELOG.md' | |
| - 'CONTRIBUTING.md' | |
| pull_request: | |
| branches: [ trunk, main ] | |
| paths-ignore: | |
| - '**.md' | |
| - 'docs/**' | |
| - 'LICENSE' | |
| - 'CHANGELOG.md' | |
| - 'CONTRIBUTING.md' | |
| jobs: | |
| # Build Go binaries for all platforms | |
| build-go: | |
| name: Build Go Core (${{ matrix.platform }}) | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| matrix: | |
| include: | |
| - platform: linux-amd64 | |
| runner: ubuntu-latest | |
| goos: linux | |
| goarch: amd64 | |
| - platform: linux-arm64 | |
| runner: ubuntu-latest | |
| goos: linux | |
| goarch: arm64 | |
| - platform: darwin-amd64 | |
| runner: macos-15 | |
| goos: darwin | |
| goarch: amd64 | |
| - platform: darwin-arm64 | |
| runner: macos-latest | |
| goos: darwin | |
| goarch: arm64 | |
| - platform: windows-amd64 | |
| runner: windows-latest | |
| goos: windows | |
| goarch: amd64 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.21' | |
| cache-dependency-path: golang/go.sum | |
| - name: Install dependencies | |
| working-directory: golang | |
| run: go mod download | |
| - name: Install cross-compilation tools (Linux ARM64) | |
| if: matrix.platform == 'linux-arm64' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-aarch64-linux-gnu | |
| - name: Build binary | |
| working-directory: golang | |
| shell: bash | |
| env: | |
| CGO_ENABLED: 1 | |
| run: | | |
| if [ "${{ matrix.platform }}" = "linux-arm64" ]; then | |
| export CC=aarch64-linux-gnu-gcc | |
| export GOOS=linux | |
| export GOARCH=arm64 | |
| fi | |
| OUTPUT="../bin/fakestack-${{ matrix.platform }}" | |
| if [ "${{ matrix.goos }}" = "windows" ]; then | |
| OUTPUT="${OUTPUT}.exe" | |
| fi | |
| VERSION=$(git describe --tags --always --dirty 2>/dev/null || echo "dev") | |
| go build -ldflags="-s -w -X main.Version=${VERSION}" -o "$OUTPUT" | |
| - name: Upload binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: binary-${{ matrix.platform }} | |
| path: bin/fakestack-* | |
| retention-days: 7 | |
| # Test Go core | |
| test-go: | |
| name: Test Go Core | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.21' | |
| cache-dependency-path: golang/go.sum | |
| - name: Install dependencies | |
| working-directory: golang | |
| run: go mod download | |
| - name: Run tests | |
| working-directory: golang | |
| run: go test -v -race -coverprofile=coverage.out -covermode=atomic ./... | |
| - name: Build | |
| working-directory: golang | |
| run: go build -o fakestack -v . | |
| - name: Test binary | |
| working-directory: golang | |
| run: | | |
| ./fakestack -d . | |
| ./fakestack -c -p -f schema.json | |
| ls -l test.db 2>/dev/null || echo "test.db created" | |
| sqlite3 test.db "SELECT COUNT(*) FROM users;" || echo "SQLite test completed" | |
| # Test Python wrapper | |
| test-python: | |
| name: Test Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| needs: build-go | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download binaries | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: binary-* | |
| path: python/fakestack/bin | |
| merge-multiple: true | |
| - name: Make binaries executable | |
| if: runner.os != 'Windows' | |
| run: chmod +x python/fakestack/bin/* | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' | |
| - name: Install Python package | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install --upgrade "setuptools>=61.0" wheel | |
| cd python && pip install -e . | |
| - name: Test Python wrapper | |
| shell: bash | |
| run: | | |
| python -m fakestack.runner -d . | |
| python -m fakestack.runner -c -p -f schema.json | |
| ls -l test.db 2>/dev/null || echo "Database created successfully" | |
| - name: Install dev dependencies | |
| run: cd python && pip install -e ".[dev]" | |
| - name: Run tests | |
| working-directory: python | |
| run: pytest tests/ -v | |
| - name: Lint with flake8 | |
| working-directory: python | |
| run: | | |
| flake8 fakestack --count --select=E9,F63,F7,F82 --show-source --statistics | |
| flake8 fakestack --count --exit-zero --max-complexity=10 --max-line-length=135 --extend-ignore=E203,F401 --statistics | |
| - name: Check formatting with black | |
| working-directory: python | |
| run: black --check fakestack/ | |
| - name: Check import sorting with isort | |
| working-directory: python | |
| run: isort --check-only fakestack/ | |
| # Test Node.js wrapper | |
| test-nodejs: | |
| name: Test Node.js ${{ matrix.node-version }} on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| needs: build-go | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| node-version: ["18", "20", "22"] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download binaries | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: binary-* | |
| path: node/bin | |
| merge-multiple: true | |
| - name: Make binaries executable | |
| if: runner.os != 'Windows' | |
| run: chmod +x node/bin/* | |
| - name: Set up Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| cache-dependency-path: node/package-lock.json | |
| - name: Install dependencies | |
| working-directory: node | |
| run: npm ci | |
| - name: Build TypeScript | |
| working-directory: node | |
| run: npm run build | |
| - name: Run tests | |
| working-directory: node | |
| run: npm test | |
| - name: Test CLI directly | |
| working-directory: node | |
| shell: bash | |
| run: | | |
| node dist/cli.js -d . | |
| node dist/cli.js -c -p -f schema.json | |
| ls -l test.db 2>/dev/null || echo "Database created successfully" | |
| # Summary | |
| test-summary: | |
| name: Test Summary | |
| runs-on: ubuntu-latest | |
| needs: [test-go, test-python, test-nodejs] | |
| if: always() | |
| steps: | |
| - name: Check test results | |
| run: | | |
| FAILED=false | |
| if [[ "${{ needs.test-go.result }}" == "failure" ]]; then | |
| echo "❌ Go tests failed" | |
| FAILED=true | |
| fi | |
| if [[ "${{ needs.test-python.result }}" == "failure" ]]; then | |
| echo "❌ Python tests failed" | |
| FAILED=true | |
| fi | |
| if [[ "${{ needs.test-nodejs.result }}" == "failure" ]]; then | |
| echo "❌ Node.js tests failed" | |
| FAILED=true | |
| fi | |
| if [[ "$FAILED" == "true" ]]; then | |
| echo "" | |
| echo "❌ Some test jobs failed" | |
| exit 1 | |
| else | |
| echo "✅ All test jobs passed successfully" | |
| echo " - Go core: ${{ needs.test-go.result }}" | |
| echo " - Python wrapper: ${{ needs.test-python.result }}" | |
| echo " - Node.js wrapper: ${{ needs.test-nodejs.result }}" | |
| fi |