Skip to content

Remote benchmarks

Remote benchmarks #7

Workflow file for this run

# This workflow runs quality checks and tests for the golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
quality-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.24.6"
- name: Check formatting
run: |
make fmt
if [ -n "$(git diff --name-only)" ]; then
echo "Code is not properly formatted. Please run 'make fmt'"
git diff
exit 1
fi
- name: Run Go vet
run: make lint
- name: Run Shellcheck
run: |
sudo apt-get update
sudo apt-get install -y shellcheck
make shellcheck
test:
runs-on: ubuntu-latest
needs: quality-checks
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.24.6"
- name: Test
run: make test
- name: Coverage
run: make coverage
- name: Codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: bash <(curl -s https://codecov.io/bash)
docker-build:
runs-on: ubuntu-latest
needs: [quality-checks, test]
# Only build and push Docker images on main branch after tests pass
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build info
run: make docker-info
- name: Build and push Docker image
run: make docker-push
env:
DOCKER_PUSH: true
deploy:
runs-on: ubuntu-latest
needs: docker-build
# Deploy to Fly.io after Docker image is built and pushed
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
environment:
name: trunk
steps:
- uses: actions/checkout@v4
- name: Setup Fly CLI
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Deploy to Fly.io
run: |
cd examples/deployments/fly.io
./deploy.sh
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}