mirror of
https://github.com/retailcrm/api-client-go.git
synced 2025-02-16 12:53:14 +03:00
58 lines
1.5 KiB
YAML
58 lines
1.5 KiB
YAML
|
name: ci
|
||
|
|
||
|
on:
|
||
|
push:
|
||
|
branches:
|
||
|
- '**'
|
||
|
tags-ignore:
|
||
|
- '*.*'
|
||
|
pull_request:
|
||
|
|
||
|
env:
|
||
|
DEVELOPER_NODE: 1
|
||
|
RETAILCRM_URL: https://test.retailcrm.pro
|
||
|
RETAILCRM_KEY: key
|
||
|
|
||
|
jobs:
|
||
|
tests:
|
||
|
name: Tests
|
||
|
runs-on: ubuntu-latest
|
||
|
strategy:
|
||
|
matrix:
|
||
|
go-version: ['1.8', '1.9', '1.10', '1.11', '1.12', '1.13']
|
||
|
include:
|
||
|
- go-version: '1.14'
|
||
|
coverage: 1
|
||
|
steps:
|
||
|
- name: Set up Go ${{ matrix.go-version }}
|
||
|
uses: actions/setup-go@v2
|
||
|
with:
|
||
|
go-version: ${{ matrix.go-version }}
|
||
|
- name: Check out code into the Go module directory
|
||
|
uses: actions/checkout@v2
|
||
|
- name: Get dependencies
|
||
|
run: |
|
||
|
go get -v github.com/google/go-querystring/query
|
||
|
go get -v github.com/h2non/gock
|
||
|
go get -v github.com/joho/godotenv
|
||
|
go get -v github.com/retailcrm/api-client-go/errs
|
||
|
cp .env.dist .env
|
||
|
- name: Tests
|
||
|
env:
|
||
|
COVERAGE: ${{ matrix.coverage }}
|
||
|
if: env.COVERAGE != 1
|
||
|
run: go test ./...
|
||
|
- name: Tests with coverage
|
||
|
env:
|
||
|
COVERAGE: ${{ matrix.coverage }}
|
||
|
if: env.COVERAGE == 1
|
||
|
run: |
|
||
|
go test ./... -race -coverprofile=coverage.txt -covermode=atomic "$d"
|
||
|
- name: Coverage
|
||
|
env:
|
||
|
COVERAGE: ${{ matrix.coverage }}
|
||
|
if: env.COVERAGE == 1
|
||
|
run: |
|
||
|
bash <(curl -s https://codecov.io/bash)
|
||
|
rm coverage.txt
|