feat(live_monitor_ts): create pipline tests and lint
This commit is contained in:
parent
22d37bb0a4
commit
c83a03684c
64
.gitea/workflows/alerter.yml
Normal file
64
.gitea/workflows/alerter.yml
Normal 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
|
||||
38
.gitea/workflows/live_monitor_ui.yml
Normal file
38
.gitea/workflows/live_monitor_ui.yml
Normal 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
|
||||
Loading…
x
Reference in New Issue
Block a user