mirror of
https://github.com/grdl/git-get.git
synced 2026-02-04 15:39:46 +00:00
Set git user and email in tests helper instead of CI jobs. Simplify CI
This commit is contained in:
56
.github/workflows/ci.yml
vendored
56
.github/workflows/ci.yml
vendored
@@ -38,23 +38,13 @@ jobs:
|
||||
|
||||
- name: Verify dependencies
|
||||
run: go mod verify
|
||||
|
||||
- name: Build binary
|
||||
run: go build -v -o bin/git-get ./cmd/
|
||||
|
||||
- name: Run tests
|
||||
run: go test -race ./...
|
||||
|
||||
- name: Set up Git (for tests)
|
||||
run: |
|
||||
git config --global user.email "test@example.com"
|
||||
git config --global user.name "CI Test"
|
||||
|
||||
- name: Run tests with coverage
|
||||
run: go test -race -coverprofile coverage.out -covermode=atomic ./...
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.24'
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
file: ./coverage.out
|
||||
flags: unittests
|
||||
name: codecov-umbrella
|
||||
fail_ci_if_error: false
|
||||
|
||||
lint:
|
||||
name: Lint
|
||||
@@ -104,37 +94,3 @@ jobs:
|
||||
with:
|
||||
sarif_file: 'trivy-results.sarif'
|
||||
|
||||
build:
|
||||
name: Build
|
||||
needs: [test, lint, security]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.24'
|
||||
cache: true
|
||||
|
||||
- name: Build binary
|
||||
run: |
|
||||
go build -v -o bin/git-get ./cmd/
|
||||
|
||||
- name: Test binary and symlink behavior
|
||||
run: |
|
||||
./bin/git-get --version
|
||||
# Test symlink functionality
|
||||
ln -sf git-get bin/git-list
|
||||
./bin/git-list --version
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: binary
|
||||
path: bin/
|
||||
retention-days: 30
|
||||
|
||||
Reference in New Issue
Block a user