Skip to content

refactor(cors): support cors via rs/cors #68

refactor(cors): support cors via rs/cors

refactor(cors): support cors via rs/cors #68

Workflow file for this run

# 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: ci
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
# database provided by github action runner
REST_MYSQL_URL: mysql://root:root@tcp(127.0.0.1:3306)/test
REST_PG_URL: postgres://postgres:[email protected]:5432/postgres
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
mysql:
image: mysql
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test
# Set health checks to wait until postgres has started
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=10
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Vet
run: |
go vet ./...
- name: Unit tests
run: |
go test ./... -race -v -coverprofile coverage.txt -covermode=atomic
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos