name: Build on: push: pull_request: branches: [main] workflow_dispatch: jobs: build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v5 - name: Set up Go if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' uses: actions/setup-go@v7 with: go-version-file: go.mod cache-dependency-path: go.sum - name: Install test dependencies if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' run: | sudo apt-get update sudo apt-get install -y --no-install-recommends zlib1g-dev - name: Test if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' run: go test ./... - name: Vet if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' run: go vet ./... - name: Set up QEMU (arm64 emulation) uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build release binary if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' run: make release - name: Build binary if: github.event_name != 'pull_request' && github.ref != 'refs/heads/main' run: make build - name: Upload binary if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' uses: actions/upload-artifact@v4 with: name: mapd path: build/mapd