Skip to content

Feature: Sophisticated Git Workflow Implementation #2

Feature: Sophisticated Git Workflow Implementation

Feature: Sophisticated Git Workflow Implementation #2

Workflow file for this run

name: Feature Branch CI
on:
push:
branches: [ 'feature/*' ]
pull_request:
branches: [ 'develop' ]
env:
GO_VERSION: '1.24.0'
jobs:
validate:
name: Validate Feature
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install dependencies
run: go mod download
- name: Run linter
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --config .golangci.yml
- name: Check file sizes
run: make check-file-length
- name: Run tests with coverage
run: |
go test -v -race -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
file: ./coverage.out
flags: feature-tests
name: feature-coverage
- name: Build application
run: make build
- name: Security scan
uses: securecodewarrior/github-action-gosec@master
with:
args: '-no-fail -fmt sarif -out results.sarif ./...'
- name: Upload security results
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif
if: always()
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: feature-build-${{ github.sha }}
path: bin/
if: success()