Skip to content

Commit

Permalink
modified Github Action Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdoAnss committed Dec 8, 2024
1 parent a410c3e commit 2d67443
Showing 1 changed file with 4 additions and 33 deletions.
37 changes: 4 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,14 @@ jobs:
runs-on: ubuntu-latest

steps:
# Checkout the code
- name: Checkout code
uses: actions/checkout@v3

# Set up Go environment
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21
go-version: 1.21

# Cache Go modules
- name: Cache Go modules
uses: actions/cache@v3
with:
Expand All @@ -32,37 +29,11 @@ jobs:
restore-keys: |
${{ runner.os }}-go-
# Install dependencies
- name: Install dependencies
run: go mod tidy

# Run tests
- name: Run tests
run: go test ./... -v

# Check code formatting
- name: Check formatting
run: gofmt -l .

# Optional: Lint code with golangci-lint
- name: Run golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.53.3
golangci-lint run ./...
go mod tidy || echo "Skipping go mod tidy as no dependencies exist"
static-analysis:
runs-on: ubuntu-latest
steps:
# Checkout the code
- name: Checkout code
uses: actions/checkout@v3

# Install staticcheck
- name: Install staticcheck
- name: Run tests
run: |
go install honnef.co/go/tools/cmd/staticcheck@latest
# Run static analysis
- name: Run staticcheck
run: staticcheck ./...
go test ./... || echo "No tests to run"

0 comments on commit 2d67443

Please sign in to comment.