Refactor CI workflow to verify and install CGO dependencies
Some checks failed
CI/CD Pipeline / e2e-test (push) Blocked by required conditions
CI/CD Pipeline / backend-lint (push) Failing after 33s
CI/CD Pipeline / backend-build (push) Has been skipped
CI/CD Pipeline / frontend-lint (push) Successful in 1m39s
CI/CD Pipeline / frontend-build (push) Has been cancelled

- Change step name to "Verify CGO dependencies" and implement a check for GCC availability
- Update environment variables to ensure CGO is enabled during Go module operations
- Allow the installation of GCC to continue on error for improved resilience
This commit is contained in:
Damir Mukimov 2025-12-26 13:23:17 +01:00
parent 0e56f50c38
commit 1f3ec085cd
No known key found for this signature in database
GPG Key ID: 42996CC7C73BC750

View File

@ -65,15 +65,23 @@ jobs:
with:
go-version: '1.25.3'
cache: true
- name: Install CGO dependencies
- name: Verify CGO dependencies
run: |
sudo apt-get update
sudo apt-get install -y gcc
# Check if gcc is available (usually pre-installed on Ubuntu runners)
if command -v gcc &> /dev/null; then
echo "gcc is already available"
gcc --version
else
echo "gcc not found, attempting to install..."
apt-get update && apt-get install -y gcc || echo "gcc installation failed, but continuing..."
fi
continue-on-error: true
- name: Install dependencies
working-directory: bugulma/backend
run: go mod download
env:
GO111MODULE: on
CGO_ENABLED: 1
GOPROXY: https://proxy.golang.org,direct
GOSUMDB: sum.golang.org
- name: Tidy and verify modules
@ -83,6 +91,7 @@ jobs:
go mod verify
env:
GO111MODULE: on
CGO_ENABLED: 1
GOPROXY: https://proxy.golang.org,direct
GOSUMDB: sum.golang.org
- name: Verify module setup
@ -95,6 +104,7 @@ jobs:
go list ./...
env:
GO111MODULE: on
CGO_ENABLED: 1
GOPROXY: https://proxy.golang.org,direct
GOSUMDB: sum.golang.org
- name: Build module to populate cache
@ -102,6 +112,7 @@ jobs:
run: go build ./...
env:
GO111MODULE: on
CGO_ENABLED: 1
GOPROXY: https://proxy.golang.org,direct
GOSUMDB: sum.golang.org
- name: Vet
@ -109,6 +120,7 @@ jobs:
run: go vet ./...
env:
GO111MODULE: on
CGO_ENABLED: 1
GOPROXY: https://proxy.golang.org,direct
GOSUMDB: sum.golang.org
- name: Test