feat(live_monitor_ts): create pipline tests and lint

This commit is contained in:
Vyacheslav 2024-04-24 11:15:37 +03:00
parent 22d37bb0a4
commit c83a03684c
2 changed files with 102 additions and 0 deletions

View File

@ -0,0 +1,64 @@
name: go
on:
push:
paths:
- alerter/**
branches:
- main
pull_request:
paths:
- alerter/**
branches:
- main
env:
GO111MODULE: "on"
jobs:
lint:
runs-on: ubuntu
if: ${{ !contains(github.ref, 'calendar') }}
steps:
- name: Extract branch name
run: echo "BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ~1.22
- name: Check out code
uses: actions/checkout@v3
- name: Linters
uses: golangci/golangci-lint-action@v4.0.0
with:
version: latest
skip-build-cache: true
skip-pkg-cache: true
working-directory: ./alerter
tests:
runs-on: ubuntu
if: ${{ !contains(github.ref, 'calendar') }}
steps:
- name: Extract branch name
run: echo "BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ^1.22
- name: Check out code
uses: actions/checkout@v3
- name: Unit tests
run: go test -v -count=1 -race -timeout=1m ./...
working-directory: ./alerter
- name: Optimization tests
run: go test -v -count=1 -timeout=1m -tags bench ./...
if: env.BRANCH == 'hw10_program_optimization'
working-directory: ./alerter

View File

@ -0,0 +1,38 @@
name: live_monitor_ui
on:
push:
branches:
- main
- live_monitor_ts_workflow
pull_request:
branches:
- main
- live_monitor_ts_workflow
jobs:
lint:
name: lint
runs-on: 'ubuntu'
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: cd live_monitor_ts
run: cd live_monitor_ts
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: '21.x'
- name: install yarn
run: npm install --global yarn
- name: install node_modules
run: npm install
working-directory: ./live_monitor_ts
- name: lint
run: npm run lint
working-directory: ./live_monitor_ts