Full Multi-Architecture Enablement for Harbor (amd64 + arm64) #21597
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
env: | |
POSTGRESQL_HOST: localhost | |
POSTGRESQL_PORT: 5432 | |
POSTGRESQL_USR: postgres | |
POSTGRESQL_PWD: root123 | |
POSTGRESQL_DATABASE: registry | |
DOCKER_COMPOSE_VERSION: 2.27.1 | |
HARBOR_ADMIN: admin | |
HARBOR_ADMIN_PASSWD: Harbor12345 | |
CORE_SECRET: tempString | |
KEY_PATH: "/data/secret/keys/secretkey" | |
REDIS_HOST: localhost | |
REG_VERSION: v2.7.1-patch-2819-2553 | |
UI_BUILDER_VERSION: 1.6.0 | |
on: | |
# the paths-ignore is the same as the paths in pass-CI.yml, they should be synced together | |
# see https://web.archive.org/web/20230506145443/https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/troubleshooting-required-status-checks#handling-skipped-but-required-checks | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
- '**.md' | |
- 'tests/**' | |
- '!tests/**.sh' | |
- '!tests/apitests/**' | |
- '!tests/ci/**' | |
- '!tests/resources/**' | |
- '!tests/robot-cases/**' | |
- '!tests/robot-cases/Group1-Nightly/**' | |
push: | |
# the paths-ignore is the same as the paths in pass-CI.yml, they should be synced together | |
paths-ignore: | |
- 'docs/**' | |
- '**.md' | |
- 'tests/**' | |
- '!tests/**.sh' | |
- '!tests/apitests/**' | |
- '!tests/ci/**' | |
- '!tests/resources/**' | |
- '!tests/robot-cases/**' | |
- '!tests/robot-cases/Group1-Nightly/**' | |
jobs: | |
UTTEST: | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [amd64, arm64] | |
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }} | |
env: | |
UTTEST: true | |
ARCH: ${{ matrix.arch }} | |
timeout-minutes: 100 | |
steps: | |
- name: Set up Go 1.23 | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.23.2 | |
id: go | |
- uses: actions/checkout@v5 | |
with: | |
path: src/github.com/goharbor/harbor | |
- name: setup env | |
run: | | |
cd src/github.com/goharbor/harbor | |
pwd | |
go env | |
echo "GOPATH=$(go env GOPATH):$GITHUB_WORKSPACE" >> $GITHUB_ENV | |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
echo "TOKEN_PRIVATE_KEY_PATH=${GITHUB_WORKSPACE}/src/github.com/goharbor/harbor/tests/private_key.pem" >> $GITHUB_ENV | |
shell: bash | |
- name: before_install | |
run: | | |
set -x | |
cd src/github.com/goharbor/harbor | |
pwd | |
env | |
#sudo apt install -y xvfb | |
#xvfb-run ls | |
curl -L https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose | |
chmod +x docker-compose | |
sudo mv docker-compose /usr/local/bin | |
IP=`hostname -I | awk '{print $1}'` | |
echo '{"insecure-registries" : ["'$IP':5000"]}' | sudo tee /etc/docker/daemon.json | |
echo "IP=$IP" >> $GITHUB_ENV | |
sudo cp ./tests/harbor_ca.crt /usr/local/share/ca-certificates/ | |
sudo update-ca-certificates | |
sudo service docker restart | |
- name: install | |
run: | | |
cd src/github.com/goharbor/harbor | |
env | |
df -h | |
bash ./tests/showtime.sh ./tests/ci/ut_install.sh | |
- name: Wait for redis-photon (arm64 only) | |
if: matrix.arch == 'arm64' | |
run: | | |
echo "Waiting for redis-photon container to be healthy..." | |
for i in {1..30}; do | |
if docker ps --filter "name=redis" --filter "health=healthy" | grep redis; then | |
echo "redis-photon is healthy" | |
break | |
fi | |
echo "Retry $i: redis-photon not healthy yet" | |
docker ps | |
sleep 2 | |
done | |
docker ps --filter "name=redis" --filter "health=healthy" | grep redis || \ | |
(echo "redis-photon never became healthy" && exit 1) | |
- name: script | |
run: | | |
echo IP: $IP | |
df -h | |
cd src/github.com/goharbor/harbor | |
bash ./tests/showtime.sh ./tests/ci/ut_run.sh $IP | |
df -h | |
- name: Codecov For BackEnd | |
uses: codecov/codecov-action@v5 | |
with: | |
files: ./src/github.com/goharbor/harbor/profile.cov | |
flags: unittests,linux-${{ matrix.arch }} | |
APITEST_DB: | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [amd64, arm64] | |
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }} | |
env: | |
APITEST_DB: true | |
ARCH: ${{ matrix.arch }} | |
timeout-minutes: 100 | |
steps: | |
- name: Set up Go 1.23 | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.23.2 | |
id: go | |
- uses: actions/checkout@v5 | |
with: | |
path: src/github.com/goharbor/harbor | |
- name: Build E2E engine locally (arm64 only) | |
if: matrix.arch == 'arm64' | |
run: | | |
cd src/github.com/goharbor/harbor/tests/test-engine-image | |
chmod +x build.sh | |
./build.sh api latest | |
# Tag as "latest-api" to satisfy test scripts | |
docker tag goharbor/harbor-e2e-engine:latest-api goharbor/harbor-e2e-engine:latest-api | |
- name: setup env | |
run: | | |
cd src/github.com/goharbor/harbor | |
pwd | |
go env | |
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | |
echo "GOPATH=$(go env GOPATH):$GITHUB_WORKSPACE" >> $GITHUB_ENV | |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
echo "TOKEN_PRIVATE_KEY_PATH=${GITHUB_WORKSPACE}/src/github.com/goharbor/harbor/tests/private_key.pem" >> $GITHUB_ENV | |
IP=`hostname -I | awk '{print $1}'` | |
echo "IP=$IP" >> $GITHUB_ENV | |
shell: bash | |
- name: before_install | |
run: | | |
set -x | |
cd src/github.com/goharbor/harbor | |
pwd | |
env | |
df -h | |
#sudo apt install -y xvfb | |
#xvfb-run ls | |
curl -L https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose | |
chmod +x docker-compose | |
sudo mv docker-compose /usr/local/bin | |
- name: install | |
run: | | |
cd src/github.com/goharbor/harbor | |
env | |
df -h | |
docker system prune -a -f | |
bash ./tests/showtime.sh ./tests/ci/api_common_install.sh $IP DB | |
- name: script | |
run: | | |
cd src/github.com/goharbor/harbor | |
echo IP: $IP | |
df -h | |
bash ./tests/showtime.sh ./tests/ci/api_run.sh DB $IP | |
df -h | |
- name: upload_logs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: db-api-harbor-logs.tar.gz | |
path: /home/runner/work/harbor/harbor/src/github.com/goharbor/harbor/integration_logs.tar.gz | |
retention-days: 5 | |
APITEST_DB_PROXY_CACHE: | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [amd64, arm64] | |
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }} | |
env: | |
APITEST_DB: true | |
ARCH: ${{ matrix.arch }} | |
timeout-minutes: 100 | |
steps: | |
- name: Set up Go 1.23 | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.23.2 | |
id: go | |
- uses: actions/checkout@v5 | |
with: | |
path: src/github.com/goharbor/harbor | |
- name: Build E2E engine locally (arm64 only) | |
if: matrix.arch == 'arm64' | |
run: | | |
cd src/github.com/goharbor/harbor/tests/test-engine-image | |
chmod +x build.sh | |
./build.sh api latest | |
docker tag goharbor/harbor-e2e-engine:latest-api goharbor/harbor-e2e-engine:latest-api | |
- name: setup env | |
run: | | |
cd src/github.com/goharbor/harbor | |
pwd | |
go env | |
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | |
echo "GOPATH=$(go env GOPATH):$GITHUB_WORKSPACE" >> $GITHUB_ENV | |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
echo "TOKEN_PRIVATE_KEY_PATH=${GITHUB_WORKSPACE}/src/github.com/goharbor/harbor/tests/private_key.pem" >> $GITHUB_ENV | |
IP=`hostname -I | awk '{print $1}'` | |
echo "IP=$IP" >> $GITHUB_ENV | |
shell: bash | |
- name: before_install | |
run: | | |
set -x | |
cd src/github.com/goharbor/harbor | |
pwd | |
env | |
df -h | |
#sudo apt install -y xvfb | |
#xvfb-run ls | |
curl -L https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose | |
chmod +x docker-compose | |
sudo mv docker-compose /usr/local/bin | |
- name: install | |
run: | | |
cd src/github.com/goharbor/harbor | |
env | |
df -h | |
docker system prune -a -f | |
bash ./tests/showtime.sh ./tests/ci/api_common_install.sh $IP DB | |
- name: script | |
run: | | |
cd src/github.com/goharbor/harbor | |
echo IP: $IP | |
df -h | |
bash ./tests/showtime.sh ./tests/ci/api_run.sh PROXY_CACHE $IP | |
df -h | |
- name: upload_logs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: proxy-api-harbor-logs.tar.gz | |
path: /home/runner/work/harbor/harbor/src/github.com/goharbor/harbor/integration_logs.tar.gz | |
retention-days: 5 | |
APITEST_LDAP: | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [amd64, arm64] | |
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }} | |
env: | |
APITEST_LDAP: true | |
ARCH: ${{ matrix.arch }} | |
timeout-minutes: 100 | |
steps: | |
- name: Set up Go 1.23 | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.23.2 | |
id: go | |
- uses: actions/checkout@v5 | |
with: | |
path: src/github.com/goharbor/harbor | |
- name: Build E2E engine locally (arm64 only) | |
if: matrix.arch == 'arm64' | |
run: | | |
cd src/github.com/goharbor/harbor/tests/test-engine-image | |
chmod +x build.sh | |
./build.sh api latest | |
docker tag goharbor/harbor-e2e-engine:latest-api goharbor/harbor-e2e-engine:latest-api | |
- name: setup env | |
run: | | |
cd src/github.com/goharbor/harbor | |
pwd | |
go env | |
echo "GOPATH=$(go env GOPATH):$GITHUB_WORKSPACE" >> $GITHUB_ENV | |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
echo "TOKEN_PRIVATE_KEY_PATH=${GITHUB_WORKSPACE}/src/github.com/goharbor/harbor/tests/private_key.pem" >> $GITHUB_ENV | |
IP=`hostname -I | awk '{print $1}'` | |
echo "IP=$IP" >> $GITHUB_ENV | |
shell: bash | |
- name: before_install | |
run: | | |
set -x | |
cd src/github.com/goharbor/harbor | |
pwd | |
env | |
df -h | |
#sudo apt install -y xvfb | |
#xvfb-run ls | |
curl -L https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose | |
chmod +x docker-compose | |
sudo mv docker-compose /usr/local/bin | |
- name: install | |
run: | | |
cd src/github.com/goharbor/harbor | |
env | |
df -h | |
bash ./tests/showtime.sh ./tests/ci/api_common_install.sh $IP LDAP | |
- name: script | |
run: | | |
echo IP: $IP | |
df -h | |
cd src/github.com/goharbor/harbor | |
bash ./tests/showtime.sh ./tests/ci/api_run.sh LDAP $IP | |
df -h | |
- name: upload_logs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ldap-api-harbor-logs.tar.gz | |
path: /home/runner/work/harbor/harbor/src/github.com/goharbor/harbor/integration_logs.tar.gz | |
retention-days: 5 | |
OFFLINE: | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [amd64, arm64] | |
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }} | |
env: | |
OFFLINE: true | |
ARCH: ${{ matrix.arch }} | |
timeout-minutes: 100 | |
steps: | |
- name: Set up Go 1.23 | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.23.2 | |
id: go | |
- uses: actions/checkout@v5 | |
with: | |
path: src/github.com/goharbor/harbor | |
- name: setup env | |
run: | | |
cd src/github.com/goharbor/harbor | |
pwd | |
docker version | |
go env | |
echo "GOPATH=$(go env GOPATH):$GITHUB_WORKSPACE" >> $GITHUB_ENV | |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
echo "TOKEN_PRIVATE_KEY_PATH=${GITHUB_WORKSPACE}/src/github.com/goharbor/harbor/tests/private_key.pem" >> $GITHUB_ENV | |
shell: bash | |
- name: before_install | |
run: | | |
set -x | |
cd src/github.com/goharbor/harbor | |
pwd | |
env | |
df -h | |
#sudo apt install -y xvfb | |
#xvfb-run ls | |
curl -L https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose | |
chmod +x docker-compose | |
sudo mv docker-compose /usr/local/bin | |
IP=`hostname -I | awk '{print $1}'` | |
echo '{"insecure-registries" : ["'$IP':5000"]}' | sudo tee /etc/docker/daemon.json | |
echo "IP=$IP" >> $GITHUB_ENV | |
sudo cp ./tests/harbor_ca.crt /usr/local/share/ca-certificates/ | |
sudo update-ca-certificates | |
sudo service docker restart | |
- name: script | |
run: | | |
echo IP: $IP | |
df -h | |
cd src/github.com/goharbor/harbor | |
bash ./tests/showtime.sh ./tests/ci/distro_installer.sh | |
df -h | |
UI_UT: | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [amd64, arm64] | |
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }} | |
env: | |
UI_UT: true | |
ARCH: ${{ matrix.arch }} | |
timeout-minutes: 100 | |
steps: | |
- uses: actions/setup-node@v5 | |
with: | |
node-version: '18' | |
- uses: actions/checkout@v5 | |
with: | |
path: src/github.com/goharbor/harbor | |
- name: Install Chromium (arm64 only) | |
if: matrix.arch == 'arm64' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y chromium-browser || sudo apt-get install -y chromium | |
which chromium-browser || which chromium | |
echo "CHROME_BIN=$(which chromium-browser || which chromium)" >> $GITHUB_ENV | |
- name: script | |
run: | | |
echo IP: $IP | |
df -h | |
cd src/github.com/goharbor/harbor | |
bash ./tests/showtime.sh ./tests/ci/ui_ut_run.sh | |
df -h | |
- name: Codecov For UI | |
uses: codecov/codecov-action@v5 | |
with: | |
files: ./src/github.com/goharbor/harbor/src/portal/coverage/lcov.info | |
flags: unittests,linux-${{ matrix.arch }} |