name: Test Matrix on: push: branches: [main] pull_request: env: GO_VERSION: '1.25.0' jobs: test-native-vs-pure: strategy: matrix: build_type: [pure, cgo, native] runs-on: self-hosted steps: - uses: actions/checkout@v4 - name: Setup dependencies run: | sudo apt-get update sudo apt-get install -y build-essential cmake - name: Build with ${{ matrix.build_type }} run: | if [ "${{ matrix.build_type }}" = "native" ]; then scripts/build/build-native.sh fi scripts/build/build-go.sh ${{ matrix.build_type }} linux amd64 cmd/api-server/main.go - name: Run unit tests run: | export FETCHML_NATIVE_LIBS=$([ "${{ matrix.build_type }}" = "native" ] && echo "1" || echo "0") go test -v ./internal/... - name: Run integration tests run: | export FETCHML_NATIVE_LIBS=$([ "${{ matrix.build_type }}" = "native" ] && echo "1" || echo "0") go test -v ./tests/integration/... - name: Run benchmark comparison if: matrix.build_type == 'native' run: make benchmark-compare - name: Upload test results uses: actions/upload-artifact@v4 with: name: test-results-${{ matrix.build_type }} path: test-results/