fix(docker): update Go version to 1.24 in Dockerfile #63
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, develop ] | |
| paths-ignore: | |
| - 'web/**' | |
| pull_request: | |
| branches: [ main, develop ] | |
| paths-ignore: | |
| - 'web/**' | |
| env: | |
| GO_VERSION: '1.23' | |
| permissions: | |
| contents: read | |
| security-events: write | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - name: golangci-lint | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: latest | |
| args: --timeout=5m | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| go-version: ['1.22', '1.23'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| - name: Cache Go modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/go/pkg/mod | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go- | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: Run tests | |
| run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./... | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| needs: [lint, test] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - name: Build | |
| run: | | |
| CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o bin/aixgo-linux-amd64 . | |
| CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -v -o bin/aixgo-darwin-amd64 . | |
| CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -v -o bin/aixgo-darwin-arm64 . | |
| CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -v -o bin/aixgo-windows-amd64.exe . | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: binaries | |
| path: bin/ | |
| retention-days: 7 | |
| docker-build: | |
| name: Docker Build | |
| runs-on: ubuntu-latest | |
| needs: [lint, test] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Aixgo image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./docker/aixgo.Dockerfile | |
| push: false | |
| tags: aixgo/orchestrator:test | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Build Ollama image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./docker/ollama.Dockerfile | |
| push: false | |
| tags: aixgo/ollama:test | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| security: | |
| name: Security Scan | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Run Trivy vulnerability scanner | |
| uses: aquasecurity/trivy-action@master | |
| with: | |
| scan-type: 'fs' | |
| scan-ref: '.' | |
| format: 'sarif' | |
| output: 'trivy-results.sarif' | |
| - name: Upload Trivy results to GitHub Security | |
| uses: github/codeql-action/upload-sarif@v4 | |
| with: | |
| sarif_file: 'trivy-results.sarif' | |
| - name: Run Gosec Security Scanner | |
| uses: securego/gosec@master | |
| with: | |
| args: '-no-fail -fmt sarif -out gosec-results.sarif ./...' | |
| - name: Upload Gosec results to GitHub Security | |
| uses: github/codeql-action/upload-sarif@v4 | |
| with: | |
| sarif_file: 'gosec-results.sarif' |