Skip to content

Commit

Permalink
📦 Release: v0.0.1-rc.1 (#93)
Browse files Browse the repository at this point in the history
- ✨ [providers] Support for OpenAI Chat API #3 (@mkrueger12 )
- ✨ [API] #54 Unified Chat API  (@mkrueger12 )
- ✨ [providers] Support for Cohere Chat API #5 (@mkrueger12 )
- ✨ [providers] Support for Azure OpenAI Chat API #4  (@mkrueger12 )
- ✨ [providers] Support for OctoML Chat API #58 (@mkrueger12 )
- ✨ [routing] The Routing Mechanism, Adaptive Health Tracking, and Fallbacks #42 #43 #51 (@roma-glushko)
- ✨ [routing] Support for round robin routing strategy #44 (@roma-glushko)
- ✨ [routing] Support for the least latency routing strategy #46 (@roma-glushko)
- ✨ [routing] Support for weighted round robin routing strategy #45 (@roma-glushko)
- ✨ [providers] Support for Anthropic Chat API #60 (@mkrueger12 )
- ✨ [docs] OpenAPI specifications #22 (@roma-glushko )
- 🔧 [chores] Inited the project #6 (@roma-glushko)
- 🔊 [telemetry] Inited logging  #14 (@roma-glushko)
- 🔧 [chores] Inited Glide's CLI #12 (@roma-glushko)
- 👷 [chores] Setup CI workflows #8 (@roma-glushko)
- ⚙️ [config] Inited configs #11 (@roma-glushko)
-  🔧 [chores] Automatic coverage reports #39 (@roma-glushko)
- 👷 [build] Setup release workflows #9 (@roma-glushko)
  • Loading branch information
roma-glushko authored Jan 21, 2024
1 parent ad53fbe commit 1c3e68a
Show file tree
Hide file tree
Showing 128 changed files with 9,202 additions and 2 deletions.
133 changes: 133 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
name: lint

on:
workflow_call:

push:
branches:
- "main"
- "develop"

pull_request:
branches:
- "main"
- "develop"

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
check-latest: true

- name: Install
run: go install mvdan.cc/gofumpt@latest

- name: Go Format
run: gofmt -s -w . && git diff --exit-code

- name: Gofumpt
run: gofumpt -l -w . && git diff --exit-code

- name: Go Vet
run: go vet ./...

- name: Go Tidy
run: go mod tidy && git diff --exit-code

- name: Go Mod
run: go mod download

- name: Go Mod Verify
run: go mod verify

build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
check-latest: true
- name: Build
run: go build -v ./...

static-checks:
name: Static Checks
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
check-latest: true

- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest

- name: Install nilaway
run: go install go.uber.org/nilaway/cmd/nilaway@latest

- name: GolangCILint
uses: golangci/golangci-lint-action@v3.4.0
with:
version: latest
args: --timeout 5m

- name: Staticcheck
run: staticcheck ./...
# TODO: Ignore the issue in https://github.com/modelgateway/Glide/issues/32
# - name: Nilaway
# run: nilaway ./...

tests:
name: Tests
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
check-latest: true

- name: Test
run: go test -v -count=1 -race -shuffle=on -coverprofile=coverage.txt ./...

- name: Test
run: make test

- name: Upload Coverage
uses: codecov/codecov-action@v3
continue-on-error: true # we don't care if it fails
with:
token: ${{secrets.CODECOV_TOKEN}} # set in repository settings
file: ./coverage.txt # file from the previous step
fail_ci_if_error: false

api-docs:
name: OpenAPI Specs
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
check-latest: true

- name: Generate OpenAPI Schema
run: make docs-api && git diff --exit-code
75 changes: 75 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: release

on:
push:
tags:
- "*"

branches:
- main

permissions:
contents: write
packages: write

jobs:
lint:
uses: ./.github/workflows/lint.yaml
vuln:
uses: ./.github/workflows/vuln.yaml
release:
needs:
- lint
- vuln
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DISCORD_WEBHOOK_ID: ${{ secrets.DISCORD_WEBHOOK_ID }}
DISCORD_WEBHOOK_TOKEN: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
BREW_TAP_PRIVATE_KEY: ${{ secrets.BREW_TAP_PRIVATE_KEY }}
images:
strategy:
matrix:
image:
- alpine
- ubuntu
- distroless
- redhat
runs-on: ubuntu-latest
needs:
- release
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: login into Github Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: build ${{ matrix.image }} image
working-directory: ./images
env:
BUILD_TIME: ${{needs.build_time.outputs.BUILD_TIME}}
run: VERSION=${{ github.ref_name }} COMMIT=$(git rev-parse --short "$GITHUB_SHA") make ${{ matrix.image }}

- name: publish ${{ matrix.image }} image to Github Container Registry
working-directory: ./images
run: VERSION=${{ github.ref_name }} make publish-ghcr-${{ matrix.image }}
46 changes: 46 additions & 0 deletions .github/workflows/vuln.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: vuln

on:
workflow_call:

push:
branches:
- "main"
- "develop"

pull_request:
branches:
- "main"
- "develop"

schedule:
- cron: '0 10 * * 1' # run "At 10:00 on Monday"

jobs:
run:
name: Vulnerability Check
runs-on: ubuntu-latest
timeout-minutes: 5
env:
GO111MODULE: on
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: '1.21.5'
check-latest: true

- name: Checkout
uses: actions/checkout@v3

- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest

- name: Install gosec
run: go install github.com/securego/gosec/v2/cmd/gosec@latest

- name: Govulncheck
run: govulncheck -test ./...

- name: Govulncheck
run: gosec ./...
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.idea
dist
.env
config.yaml
bin
glide
tmp
coverage.txt
precommit.txt
.vscode/settings.json
1 change: 1 addition & 0 deletions .go-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.21
42 changes: 42 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
output:
# Make output more digestible with quickfix in vim/emacs/etc.
sort-results: true
print-issued-lines: false

linters:
enable:
- nolintlint
- revive
- staticcheck
- asasalint
- bodyclose
- contextcheck
- cyclop
- dupword
- errname
- exhaustive
- loggercheck
- misspell
- nestif
- perfsprint
- prealloc
- predeclared
- testifylint
- unconvert
- usestdlibvars
- wsl

linters-settings:
govet:
# These govet checks are disabled by default, but they're useful.
enable:
- niliness
- reflectvaluecompare
- sortslice
- unusedwrite
- defers
- atomic
- nilfunc
- printf
- sortslice
- tests
Loading

0 comments on commit 1c3e68a

Please sign in to comment.