fix: plan usage with overages #948
Workflow file for this run
This file contains 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
# This workflow will build a golang project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
name: Go | |
on: | |
pull_request_target: | |
branches: [ "main" ] | |
env: | |
TURSO_API_TOKEN: ${{ secrets.TURSOCI_TOKEN }} | |
jobs: | |
authorize: | |
environment: | |
${{ github.event_name == 'pull_request_target' && | |
github.event.pull_request.head.repo.full_name != github.repository && | |
'external' || 'internal' }} | |
runs-on: ubuntu-latest | |
steps: | |
- run: true | |
build: | |
needs: authorize | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha || github.ref }} | |
#ref: "refs/pull/${{ github.event.number }}/merge" # THIS IS INSECURE | |
- name: Setup Golang with cache | |
uses: magnetikonline/action-golang-cache@v4 | |
with: | |
go-version-file: go.mod | |
- name: TidyTree | |
run: if [ "$(go mod tidy && git diff | wc -l)" -gt 0 ]; then exit 1; fi | |
- name: Format | |
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi | |
- name: Install dependencies | |
run: go get -v ./... | |
- name: Build | |
run: go build -v ./... | |
- name: Vet | |
run: go vet -v ./... | |
- name: Install sqlclosecheck | |
run: go install github.com/ryanrolds/sqlclosecheck@latest | |
- name: sqlclosecheck | |
run: go vet -vettool=${HOME}/go/bin/sqlclosecheck ./... | |
- name: Staticcheck | |
uses: dominikh/staticcheck-action@v1.3.0 | |
with: | |
version: "2023.1.2" | |
build-tags: "preview" | |
install-go: false | |
- name: Test | |
run: go test -v ./... | |
- name: Build Turso binary | |
run: go build -o turso cmd/turso/main.go | |
- name: Integration tests checkout | |
uses: actions/checkout@v3 | |
with: | |
repository: chiselstrike/tursotest | |
ref: 'main' | |
path: 'tests' | |
token: ${{ secrets.ACCESS_TOKEN_TO_TESTS }} | |
- name: Integration Test | |
run: cd tests && export TURSO_BINARY=../turso && go run cmd/tursotest/main.go -test.v -test.count=1 run integrationtests | |