mirror of
https://github.com/retailcrm/api-client-go.git
synced 2024-11-24 05:46:05 +03:00
1bd5b77b3f
correct example for methods fix linters error add `/api/v5/orders/{externalId}/delivery/cancel`, `/api/v5/store/product-groups/create`, `/api/v5/store/product-groups/{externalId}/edit`
76 lines
1.9 KiB
YAML
76 lines
1.9 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '**'
|
|
tags-ignore:
|
|
- '*.*'
|
|
pull_request:
|
|
|
|
env:
|
|
RETAILCRM_URL: https://test.retailcrm.pro
|
|
RETAILCRM_KEY: key
|
|
|
|
jobs:
|
|
golangci:
|
|
name: lint
|
|
if: ${{ github.event_name == 'pull_request' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v2
|
|
- name: Set up Go 1.17
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: '1.17'
|
|
- name: Get dependencies
|
|
run: |
|
|
go mod tidy
|
|
cp .env.dist .env
|
|
- name: Lint code with golangci-lint
|
|
uses: golangci/golangci-lint-action@v3
|
|
with:
|
|
version: v1.45.2
|
|
only-new-issues: true
|
|
skip-pkg-cache: true
|
|
args: --build-tags=testutils
|
|
tests:
|
|
name: Tests
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
go-version: ['1.13', '1.14', '1.15', '1.16', '1.17']
|
|
include:
|
|
- go-version: '1.17'
|
|
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 mod tidy
|
|
cp .env.dist .env
|
|
- name: Tests
|
|
env:
|
|
COVERAGE: ${{ matrix.coverage }}
|
|
if: env.COVERAGE != 1
|
|
run: go test -tags=testutils ./...
|
|
- name: Tests with coverage
|
|
env:
|
|
COVERAGE: ${{ matrix.coverage }}
|
|
if: env.COVERAGE == 1
|
|
run: |
|
|
go test -tags=testutils ./... -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
|