@@ -19,9 +19,12 @@ permissions:
1919
2020jobs :
2121 test-production-conditions :
22- name : Test Production Logic (GitHub-hosted fallback)
23- # Test the logic but fallback to GitHub-hosted if self-hosted unavailable
22+ name : Test Production Logic & Artifactory
23+ # Test production artifactory and logic using GitHub-hosted runner
2424 runs-on : ubuntu-24.04
25+ env :
26+ # Override to test production artifactory
27+ GOPROXY : ${{ github.repository_owner == 'nginx' && format('https://{0}:{1}@azr.artifactory.f5net.com/artifactory/api/go/f5-nginx-go-local-approved-dependency', secrets.ARTIFACTORY_USER, secrets.ARTIFACTORY_TOKEN) || 'direct' }}
2528 steps :
2629 - name : Checkout Repository
2730 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -54,43 +57,32 @@ jobs:
5457
5558 - name : Test Production Artifactory Access
5659 run : |
57- echo "🔐 Testing Artifactory Access:"
58- echo "Current GOPROXY (should be dev for this branch ): $GOPROXY"
60+ echo "🔐 Testing Production Artifactory Access:"
61+ echo "Current GOPROXY (forced to production ): $GOPROXY"
5962
60- # Test what production GOPROXY would be
61- export TEST_PROD_GOPROXY="${{ github.repository_owner == 'nginx' && format('https://{0}:{1}@azr.artifactory.f5net.com/artifactory/api/go/f5-nginx-go-local-approved-dependency', secrets.ARTIFACTORY_USER, secrets.ARTIFACTORY_TOKEN) || 'direct' }}"
62- echo "Production GOPROXY would be: $TEST_PROD_GOPROXY"
63-
64- # Test what development GOPROXY is
65- export TEST_DEV_GOPROXY="${{ github.repository_owner == 'nginx' && format('https://{0}:{1}@azr.artifactory.f5net.com/artifactory/api/go/f5-nginx-go-dev', secrets.ARTIFACTORY_USER, secrets.ARTIFACTORY_TOKEN) || 'direct' }}"
66- echo "Development GOPROXY (current): $TEST_DEV_GOPROXY"
67-
68- # Verify current behavior
69- if [[ "$GOPROXY" == *"f5-nginx-go-dev"* ]]; then
70- echo "✅ SUCCESS: Using development artifactory as expected for feature branch"
63+ # Verify we're using production artifactory
64+ if [[ "$GOPROXY" == *"f5-nginx-go-local-approved-dependency"* ]]; then
65+ echo "✅ SUCCESS: Using production artifactory for testing"
7166 elif [[ "$GOPROXY" == "direct" ]]; then
7267 echo "ℹ️ INFO: Using direct proxy (expected for forks)"
7368 else
74- echo "ℹ️ INFO: Unexpected GOPROXY configuration "
69+ echo "❌ ERROR: Expected production artifactory but got: $GOPROXY "
7570 fi
7671
77- # Test that production URL is properly formatted
78- if [[ "$TEST_PROD_GOPROXY" == *"f5-nginx-go-local-approved-dependency"* ]]; then
79- echo "✅ SUCCESS: Production artifactory URL is correctly formatted"
80- else
81- echo "❌ ERROR: Production artifactory URL formatting issue"
82- fi
72+ # Show what development would be for comparison
73+ export TEST_DEV_GOPROXY="${{ github.repository_owner == 'nginx' && format('https://{0}:{1}@azr.artifactory.f5net.com/artifactory/api/go/f5-nginx-go-dev', secrets.ARTIFACTORY_USER, secrets.ARTIFACTORY_TOKEN) || 'direct' }}"
74+ echo "Development GOPROXY would be: $TEST_DEV_GOPROXY"
8375
8476 - name : Setup Golang Environment
8577 uses : actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
8678 with :
8779 go-version : stable
8880 cache-dependency-path : go.sum
89- # Use current GOPROXY (development for this branch)
81+ # Use current GOPROXY
9082
9183 - name : Test Go Module Resolution
9284 run : |
93- echo "🧪 Testing Go Module Resolution:"
85+ echo "🧪 Testing Go Module Resolution with Production Artifactory :"
9486
9587 # Test basic Go functionality
9688 go version
@@ -101,11 +93,11 @@ jobs:
10193 go list -m all > /tmp/modules.txt 2>/dev/null || true
10294 head -10 /tmp/modules.txt 2>/dev/null || echo "No modules found"
10395
104- # Test downloading a common dependency
105- echo "Testing module download (read-only) :"
96+ # Test downloading a common dependency from production artifactory
97+ echo "Testing module download from production artifactory :"
10698 go mod download github.com/stretchr/testify 2>/dev/null || echo "Download attempted"
10799
108- echo "✅ SUCCESS: Go module resolution working with development artifactory"
100+ echo "✅ SUCCESS: Go module resolution working with production artifactory"
109101
110102 - name : Test Environment Variables
111103 run : |
@@ -127,7 +119,7 @@ jobs:
127119 echo ""
128120 echo "Expected for this test:"
129121 echo "- Runner logic: ✅ (tested and validated)"
130- echo "- Development artifactory: ✅ (not main branch )"
122+ echo "- Production artifactory: ✅ (forced for testing )"
131123 echo "- Repository owner check: ✅ (nginx repo)"
132124 echo "- Self-hosted availability: ⚠️ (not tested due to runner availability)"
133125
@@ -188,7 +180,7 @@ jobs:
188180 echo ""
189181 echo "This test validates:"
190182 echo "✅ Runner selection logic (conditions tested)"
191- echo "✅ Development artifactory configuration (expected for feature branches) "
183+ echo "✅ Production vs Development artifactory access "
192184 echo "✅ Fork safety (repository_owner checks)"
193185 echo "✅ Condition logic correctness"
194186 echo ""
0 commit comments