Skip to content

ci: migrate to github actions from circle-ci #4

ci: migrate to github actions from circle-ci

ci: migrate to github actions from circle-ci #4

Workflow file for this run

name: tests
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
- name: Install dependencies
run: go mod download
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59
- name: Install revive
run: cd / && go get -u github.com/mgechev/revive@v1.3.7 && cd -
- name: revive
run: revive -config .revive.toml -formatter friendly ./...
test:
runs-on: ubuntu-latest
services:
typesense:
image: typesense/typesense:26.0
ports:
- 8108:8108/tcp
volumes:
- /tmp/typesense-server-data:/data
env:
TYPESENSE_DATA_DIR: '/data'
TYPESENSE_API_KEY: 'test_key'
TYPESENSE_ENABLE_CORS: true
TYPESENSE_URL: 'http://localhost:8108'
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
- name: Install dependencies
run: go mod download
- name: Build
run: go build -v ./...
- name: Run tests
env:
TYPESENSE_URL: 'http://localhost:8108'
TYPESENSE_API_KEY: 'test_key'
run: |
mkdir -p /tmp/test-reports
go run gotest.tools/gotestsum@latest --junitfile /tmp/test-reports/unit-tests.xml -- -tags=integration ./...
- uses: actions/upload-artifact@v4
with:
name: test-reports
path: /tmp/test-reports/
retention-days: 1