mirror of
https://github.com/HugeFrog24/go-telegram-bot.git
synced 2026-03-02 08:24:34 +00:00
Again, CI
This commit is contained in:
54
.github/workflows/go-ci.yaml
vendored
Normal file
54
.github/workflows/go-ci.yaml
vendored
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ main ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# Checkout the repository
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# Set up Go environment
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v4
|
||||||
|
with:
|
||||||
|
go-version: '1.23' # Specify the Go version you are using
|
||||||
|
|
||||||
|
# Cache Go modules
|
||||||
|
- name: Cache Go modules
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cache/go-build
|
||||||
|
~/go/pkg/mod
|
||||||
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-go-
|
||||||
|
|
||||||
|
# Install Dependencies
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: go mod tidy
|
||||||
|
|
||||||
|
# Run Linters using golangci-lint
|
||||||
|
- name: Lint Code
|
||||||
|
uses: golangci/golangci-lint-action@v6
|
||||||
|
with:
|
||||||
|
version: v1.60 # Specify the version of golangci-lint
|
||||||
|
args: --timeout 5m
|
||||||
|
|
||||||
|
# Run Tests
|
||||||
|
- name: Run Tests
|
||||||
|
run: go test ./... -v
|
||||||
|
|
||||||
|
# Security Analysis using gosec
|
||||||
|
- name: Security Scan
|
||||||
|
uses: securego/gosec@master
|
||||||
|
with:
|
||||||
|
args: ./...
|
||||||
Reference in New Issue
Block a user