Integrate fly.io #28
Workflow file for this run
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
| # 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: | | |
| go 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 |