feat: Add database migrations for smooth version upgrades #1360
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
| --- | |
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - '**/*.md' | |
| pull_request: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - '**/*.md' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| prepare: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Setup Go | |
| uses: actions/[email protected] | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - name: Prepare project | |
| run: | | |
| go mod tidy | |
| go fmt ./... | |
| - name: Check for dirty project | |
| run: | | |
| if [ -n "$(git status --porcelain)" ]; then | |
| echo "Project has uncommitted changes:" | |
| git status --porcelain | |
| git diff | |
| exit 1 | |
| fi | |
| echo "Project is clean" | |
| lint: | |
| needs: | |
| - prepare | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Setup Go | |
| uses: actions/[email protected] | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - name: Install golangci-lint | |
| uses: golangci/[email protected] | |
| with: | |
| version: v2.6.2 | |
| args: --timeout=5m | |
| vet: | |
| needs: | |
| - prepare | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Setup Go | |
| uses: actions/[email protected] | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - name: Run vet | |
| run: go vet ./... | |
| build: | |
| needs: | |
| - lint | |
| - vet | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Setup Go | |
| uses: actions/[email protected] | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - name: Install build dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc libsqlite3-dev | |
| - name: Build project | |
| env: | |
| CGO_ENABLED: 1 | |
| run: | | |
| go build \ | |
| -tags libsqlite3 \ | |
| -ldflags "\ | |
| -w -s \ | |
| -X github.com/inference-gateway/cli/cmd.version=${{ github.ref_name }} \ | |
| -X github.com/inference-gateway/cli/cmd.commit=${{ github.sha }} \ | |
| -X github.com/inference-gateway/cli/cmd.date=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \ | |
| -o infer . | |
| test: | |
| needs: | |
| - build | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Setup Go | |
| uses: actions/[email protected] | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - name: Install build dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc libsqlite3-dev | |
| - name: Run tests | |
| env: | |
| CGO_ENABLED: 1 | |
| run: go test -tags libsqlite3 ./... |