Skip to content

Cpu & memory usage fixes #1240

Cpu & memory usage fixes

Cpu & memory usage fixes #1240

Workflow file for this run

name: API Server
on:
push:
paths:
- measure-backend/measure-go/**.go
- measure-backend/measure-go/**.mod
- measure-backend/measure-go/**.sum
pull_request:
paths:
- measure-backend/measure-go/**.go
- measure-backend/measure-go/**.mod
- measure-backend/measure-go/**.sum
jobs:
build:
name: Build API server
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ["1.22.x"]
defaults:
run:
working-directory: measure-backend/measure-go
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
check-latest: true
cache-dependency-path: measure-backend/measure-go/go.sum
- name: Display go version
run: go version
- name: Install dependencies
run: go get .
- name: Build with ${{ matrix.go-version }}
run: go build -v ./...
test:
name: Test API server
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ["1.22.x"]
defaults:
run:
working-directory: measure-backend/measure-go
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
check-latest: true
cache-dependency-path: measure-backend/measure-go/go.sum
- name: Display go version
run: go version
- name: Install dependencies
run: go get .
- name: Test with ${{ matrix.go-version }}
run: go test ./...
deploy:
name: Deploy API server
if: github.ref == 'refs/heads/main'
needs: [build, test]
runs-on: ubuntu-latest
defaults:
run:
working-directory: measure-backend/measure-go
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup flyctl
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Deploy to fly.io
run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}