Skip to content

Commit

Permalink
ci: setup pipeline
Browse files Browse the repository at this point in the history
Closes #4
  • Loading branch information
askalt committed Jul 17, 2023
1 parent 859b3f9 commit 3b72474
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 62 deletions.
15 changes: 15 additions & 0 deletions .github/actions/prepare-test-env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "Prepare test environment"
description: "Prepares test environment"

runs:
using: "composite"
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '${{ env.GO_VERSION }}'

- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '${{ env.PYTHON_VERSION }}'
30 changes: 30 additions & 0 deletions .github/actions/static-code-check/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "Run static code check"
description: "Performs static code checks."

runs:
using: "composite"
steps:
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install tests requirements
run: |
pip3 install -r test/requirements.txt
shell: bash

- name: Log versions
run: |
go version
shell: bash

- name: Go Linter
uses: golangci/golangci-lint-action@v3
with:
args: --config=golangci-lint.yml --out-${NO_FUTURE}format colored-line-number
skip-cache: true

- name: Python Linter
run: python3 -m flake8 test
shell: bash
62 changes: 0 additions & 62 deletions .github/workflows/test.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Tests

on:
push:
branches-ignore:
- 'master'
pull_request:
pull_request_target:
types: [labeled]

env:
GO_VERSION: 1.14
PYTHON_VERSION: '3.x'

jobs:
tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master

- name: Prepare env
uses: ./.github/actions/prepare-test-env

- name: Static code check
uses: ./.github/actions/static-code-check

- name: Unit tests
run: make test

- name: Integration tests
run: make integration
26 changes: 26 additions & 0 deletions golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
run:
timeout: 3m

linters:
disable-all: true
enable:
- lll
- govet
- gofmt
- stylecheck

linters-settings:
lll:
line-length: 100
tab-width: 4
gofmt:
simplify: false
stylecheck:
# Temporary disable "Poorly chosen identifier" check.
checks: ["all", "-ST1003"]

issues:
exclude-rules:
- linters:
- lll
source: "\t?// (see )?https://"
5 changes: 5 additions & 0 deletions test/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pytest==6.2.5
flake8==3.8.1
flake8-unused-arguments==0.0.6
flake8-isort==4.0.0
codespell==2.2.1

0 comments on commit 3b72474

Please sign in to comment.