Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 24 additions & 12 deletions .github/workflows/apkTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,28 @@ jobs:
RTLIC: ${{ secrets.RTLIC }}
RT_CONNECTION_TIMEOUT_SECONDS: '1200'

# Run on the host runner with the host Go toolchain (1.26+).
# Tests that require the native `apk` binary skip themselves via
# apkAvailable() when apk is not on PATH (Ubuntu runner).
# The Alpine chroot approach will be re-enabled once the Go version
# constraint in go.mod aligns with Alpine's packaged Go release.
- name: Run Alpine APK tests
run: |
go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.alpine \
${{ inputs.jfrog_url != '' && format('--jfrog.url={0} --jfrog.adminToken={1}', inputs.jfrog_url, inputs.jfrog_admin_token) || '' }} \
${{ inputs.jfrog_user != '' && format('--jfrog.user={0}', inputs.jfrog_user) || '' }} \
${{ inputs.jfrog_password != '' && format('--jfrog.password={0}', inputs.jfrog_password) || '' }}
# Step 1: Compile the test binary on the host runner using Go 1.26+.
# Alpine's packaged Go does not yet reach 1.26, so we cross-compile a
# static Linux/amd64 binary here and run it inside the Alpine container.
- name: Build test binary
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go test -c -o apk.test .

# Step 2: Run the pre-built binary inside the target Alpine container.
# --network host lets the test binary reach Artifactory on localhost.
- name: Run Alpine APK tests (alpine:${{ matrix.alpine-version }})
env:
CGO_ENABLED: "0"
ALPINE_VER: ${{ matrix.alpine-version }}
run: |
docker run --rm \
--network host \
-v "${{ github.workspace }}":/workspace \
-w /workspace \
"alpine:${ALPINE_VER#v}" \
./apk.test \
-test.v \
-test.timeout 0 \
-test.run TestApk \
-test.alpine \
${{ inputs.jfrog_url != '' && format('-jfrog.url={0} -jfrog.adminToken={1}', inputs.jfrog_url, inputs.jfrog_admin_token) || '' }} \
${{ inputs.jfrog_user != '' && format('-jfrog.user={0}', inputs.jfrog_user) || '' }} \
${{ inputs.jfrog_password != '' && format('-jfrog.password={0}', inputs.jfrog_password) || '' }}
Loading
Loading