mirror of
https://github.com/LBRYFoundation/tracker.git
synced 2025-08-23 17:47:29 +00:00
115 lines
3.1 KiB
YAML
115 lines
3.1 KiB
YAML
name: CI
|
|
on:
|
|
# See the documentation for more intricate event dispatch here:
|
|
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#on
|
|
push:
|
|
branches:
|
|
- "!dependabot/*"
|
|
- "*"
|
|
pull_request:
|
|
branches:
|
|
- "*"
|
|
jobs:
|
|
build:
|
|
name: Build & Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Setup
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: ^1.15
|
|
- name: Build
|
|
run: go build -v ./cmd/...
|
|
- name: Vet
|
|
run: go vet ./...
|
|
- name: Imports
|
|
uses: Jerome1337/goimports-action@v1.0.3
|
|
- name: Format
|
|
uses: Jerome1337/gofmt-action@v1.0.4
|
|
- name: Lint
|
|
uses: Jerome1337/golint-action@v1.0.2
|
|
|
|
unit:
|
|
name: Unit Tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Setup
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: ^1.15
|
|
- name: Unit Tests
|
|
run: go test -v -race $(go list ./...)
|
|
|
|
e2e-mem:
|
|
name: E2E Tests (Memory Storage)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Setup
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: ^1.15
|
|
- name: End-to-End Test
|
|
run: |
|
|
go install ./cmd/chihaya
|
|
cat ./dist/example_config.yaml
|
|
chihaya --config=./dist/example_config.yaml --debug &
|
|
pid=$!
|
|
sleep 2
|
|
chihaya e2e --debug
|
|
kill $pid
|
|
|
|
e2e-redis:
|
|
name: E2E Tests (Redis Storage)
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
redis:
|
|
image: redis
|
|
ports: ["6379:6379"]
|
|
options: --entrypoint redis-server
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Setup
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: ^1.15
|
|
- name: Configure redis storage
|
|
run: |
|
|
curl -LO https://github.com/jzelinskie/faq/releases/download/0.0.6/faq-linux-amd64
|
|
chmod +x faq-linux-amd64
|
|
./faq-linux-amd64 '.chihaya.storage = {"config":{"gc_interval":"3m","peer_lifetime":"31m","prometheus_reporting_interval":"1s","redis_broker":"redis://127.0.0.1:6379/0","redis_connect_timeout":"15s","redis_read_timeout":"15s","redis_write_timeout":"15s"},"name":"redis"}' ./dist/example_config.yaml > ./dist/example_redis_config.yaml
|
|
cat ./dist/example_redis_config.yaml
|
|
- name: End-to-End Test
|
|
run: |
|
|
go install ./cmd/chihaya
|
|
chihaya --config=./dist/example_redis_config.yaml --debug &
|
|
pid=$!
|
|
sleep 2
|
|
chihaya e2e --debug
|
|
kill $pid
|
|
|
|
dist:
|
|
name: Helm Template
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Install Helm
|
|
uses: engineerd/configurator@v0.0.5
|
|
with:
|
|
name: helm
|
|
pathInArchive: linux-amd64/helm
|
|
fromGitHubReleases: true
|
|
repo: helm/helm
|
|
version: ^v3
|
|
urlTemplate: https://get.helm.sh/helm-{{version}}-linux-amd64.tar.gz
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Helm Template
|
|
working-directory: ./dist/helm/chihaya
|
|
run: helm template . --debug
|