Skip to content

Feature/implement sse v2 #26

Feature/implement sse v2

Feature/implement sse v2 #26

Workflow file for this run

name: Test and build API
on:
pull_request:
branches:
- main
env:
APP: ror-api
APP_PATH: cmd/api
jobs:
build-app:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.23"
- name: run generator
run: |
go run cmd/generator/main.go
- name: Test
run: |
echo testing...
export sha_short=$(git rev-parse --short HEAD)
go get -t ./...
go vet ./...
go test -v ./...
- name: Build Swagger
run: |
go install github.com/swaggo/swag/cmd/swag@latest
swag init -g cmd/api/main.go --parseDependency --output internal/docs --parseInternal
- name: Build
run: |
echo building...
export sha_short=$(git rev-parse --short HEAD)
export LIB_VER=$(cat go.mod | grep "github.com/NorskHelsenett/ror " | cut -d' ' -f2)
go get ./...
mkdir -p dist/isbuilt
CGO_ENABLED=0 go build -o dist/${{ env.APP }} -ldflags "-w -extldflags '-static' -X github.com/NorskHelsenett/ror/pkg/config/rorversion.Version=$ROR_VERSION -X github.com/NorskHelsenett/ror/pkg/config/rorversion.Commit=$sha_short -X github.com/NorskHelsenett/ror/pkg/config/rorversion.LibVer=$LIB_VER" ${{ env.APP_PATH }}/main.go
env:
ROR_VERSION: v0.0.1-build