mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-22 07:32:32 +01:00
feat(ci): trying a new CI pipeline.
This commit is contained in:
119
.github/workflows/go-improved.yml
vendored
Normal file
119
.github/workflows/go-improved.yml
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
name: Build and Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- develop
|
||||
- 'fix-*'
|
||||
- 'feature-*'
|
||||
paths:
|
||||
- 'common/**'
|
||||
- 'config/**'
|
||||
- 'network/**'
|
||||
- 'server/**'
|
||||
- 'go.mod'
|
||||
- 'go.sum'
|
||||
- '.github/workflows/go.yml'
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- develop
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Test
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.21'
|
||||
|
||||
- name: Download dependencies
|
||||
run: go mod download
|
||||
|
||||
- name: Run Tests
|
||||
run: go test -v ./... -timeout=10m
|
||||
|
||||
- name: Run Tests with Race Detector
|
||||
run: go test -race ./... -timeout=10m
|
||||
|
||||
- name: Generate Coverage Report
|
||||
run: go test -coverprofile=coverage.out ./...
|
||||
|
||||
- name: Upload Coverage to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
files: ./coverage.out
|
||||
flags: unittests
|
||||
name: codecov-umbrella
|
||||
|
||||
build:
|
||||
name: Build
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.21'
|
||||
|
||||
- name: Download dependencies
|
||||
run: go mod download
|
||||
|
||||
- name: Build Linux-amd64
|
||||
run: env GOOS=linux GOARCH=amd64 go build -v
|
||||
|
||||
- name: Upload Linux-amd64 artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Linux-amd64
|
||||
path: |
|
||||
./erupe-ce
|
||||
./config.json
|
||||
./www/
|
||||
./savedata/
|
||||
./bin/
|
||||
./bundled-schema/
|
||||
retention-days: 7
|
||||
|
||||
- name: Build Windows-amd64
|
||||
run: env GOOS=windows GOARCH=amd64 go build -v
|
||||
|
||||
- name: Upload Windows-amd64 artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Windows-amd64
|
||||
path: |
|
||||
./erupe-ce.exe
|
||||
./config.json
|
||||
./www/
|
||||
./savedata/
|
||||
./bin/
|
||||
./bundled-schema/
|
||||
retention-days: 7
|
||||
|
||||
lint:
|
||||
name: Lint
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.21'
|
||||
|
||||
- name: Run golangci-lint
|
||||
uses: golangci/golangci-lint-action@v3
|
||||
with:
|
||||
version: latest
|
||||
args: --timeout=5m --out-format=github-actions
|
||||
Reference in New Issue
Block a user