Skip to content

删除临时文档文件 RELEASE.md、GITHUB_ACTIONS_SETUP.md、FIX_IMPORT_PATHS.md #5

删除临时文档文件 RELEASE.md、GITHUB_ACTIONS_SETUP.md、FIX_IMPORT_PATHS.md

删除临时文档文件 RELEASE.md、GITHUB_ACTIONS_SETUP.md、FIX_IMPORT_PATHS.md #5

Workflow file for this run

name: CI
on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master, develop ]
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Cache Go modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download dependencies
run: go mod download
- name: Run tests
run: go test -v ./...
- name: Run linter
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --timeout=5m
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Build
run: |
if [ "${{ runner.os }}" == "Windows" ]; then
go build -o cloudbot.exe ./cmd/cloudbot
else
go build -o cloudbot ./cmd/cloudbot
fi
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: cloudbot-${{ runner.os }}
path: |
cloudbot*
retention-days: 7