Go & Docker Compatibility Test #21
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: Go & Docker Compatibility Test | |
| on: | |
| # Only run manually or on schedule to avoid blocking PRs | |
| workflow_dispatch: | |
| schedule: | |
| # Run weekly on Sundays at 6:00 AM UTC | |
| - cron: '0 6 * * 0' | |
| jobs: | |
| test-go-compatibility: | |
| name: Test Go ${{ matrix.go-version }} Compatibility | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| go-version: ['1.23', '1.24'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go ${{ matrix.go-version }} | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| - name: Test build with Go ${{ matrix.go-version }} | |
| run: | | |
| echo "Testing build with Go ${{ matrix.go-version }}" | |
| go version | |
| make build-all | |
| ./tenangdb version | |
| ./tenangdb-exporter version | |
| - name: Test Go modules | |
| run: | | |
| go mod tidy | |
| go mod download | |
| go mod verify | |
| test-docker-build: | |
| name: Test Docker Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Test Docker build | |
| run: | | |
| docker build -t tenangdb:test . | |
| - name: Test both binaries in Docker | |
| run: | | |
| # Test main binary | |
| docker run --rm tenangdb:test version | |
| # Test exporter binary | |
| docker run --rm tenangdb:test tenangdb-exporter version | |
| summary: | |
| name: Go & Docker Test Summary | |
| runs-on: ubuntu-latest | |
| needs: [test-go-compatibility, test-docker-build] | |
| if: always() | |
| steps: | |
| - name: Check results | |
| run: | | |
| echo "=== Go & Docker Compatibility Test Summary ===" | |
| echo "Go compatibility: ${{ needs.test-go-compatibility.result }}" | |
| echo "Docker build: ${{ needs.test-docker-build.result }}" | |
| if [ "${{ needs.test-go-compatibility.result }}" != "success" ] || \ | |
| [ "${{ needs.test-docker-build.result }}" != "success" ]; then | |
| echo "❌ Some tests failed" | |
| exit 1 | |
| else | |
| echo "✅ All tests passed!" | |
| fi |