Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Refactor the harbor arm build script according to the main branch. #39

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
263 changes: 257 additions & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,99 @@ env:
REDIS_HOST: localhost
REG_VERSION: v2.7.1-patch-2819-2553
UI_BUILDER_VERSION: 1.6.0
GO111MODULE: "on"
GOPROXY: "https://proxy.golang.org,direct"
GOCACHE: "/root/.cache/go-build"
GOROOT: "/usr/local/go"
GOPATH: "/root/go"
ARCH: arm64

on:
pull_request:

jobs:
UTTEST:
env:
UTTEST: true
runs-on: [self-hosted, linux, ARM64, ci]
#- self-hosted
timeout-minutes: 100
steps:
- name: Set up Go 1.19
uses: actions/setup-go@v1
with:
go-version: 1.19.3
id: go
- uses: actions/checkout@v2
with:
path: src/github.com/goharbor/harbor-arm
- name: setup env
run: |
cd src/github.com/goharbor/harbor-arm
sudo make download
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-arm/tests/private_key.pem" >> $GITHUB_ENV
shell: bash
- name: before_install
run: |
set -x
cd src/github.com/goharbor/harbor-arm
pwd
env
#sudo apt install -y xvfb
#xvfb-run ls
sudo pip3 install docker-compose
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-arm/src/github.com/goharbor/harbor
env
df -h
bash ./tests/showtime.sh ./tests/ci/ut_install.sh $ARCH
- name: script
run: |
echo IP: $IP
df -h
cd src/github.com/goharbor/harbor-arm/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@v1
with:
file: ./src/github.com/goharbor/harbor-arm/profile.cov
flags: unittests
- name: clean
run: |
set -x
cd src/github.com/goharbor/harbor-arm
bash ./tests/ci/clean.sh

APITEST_DB:
env:
APITEST_DB: true
runs-on: [self-hosted, linux, ARM64, ci]
runs-on: [self-hosted, linux, ARM64, ci, debug]
timeout-minutes: 100
steps:
- name: Set up Go 1.15
- name: Set up Go 1.19
uses: actions/setup-go@v1
with:
go-version: 1.15.12
go-version: 1.19.3
id: go
- uses: actions/checkout@v2
with:
path: src/github.com/goharbor/harbor-arm
- name: setup env
run: |
cd src/github.com/goharbor/harbor-arm
sudo make download compile_redis prepare_arm_data pre_update
sudo make download
pwd
go env
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
Expand All @@ -62,7 +132,7 @@ jobs:
env
df -h
docker system prune -a -f
bash ./tests/showtime.sh ./tests/ci/api_common_install.sh $IP DB
bash ./tests/showtime.sh ./tests/ci/api_common_install.sh $IP DB $ARCH
- name: script
run: |
cd src/github.com/goharbor/harbor-arm/src/github.com/goharbor/harbor
Expand All @@ -73,6 +143,187 @@ jobs:
- name: clean
run: |
set -x
cd src/github.com/goharbor/harbor-arm
bash ./tests/ci/clean.sh

APITEST_DB_PROXY_CACHE:
env:
APITEST_DB: true
runs-on: [self-hosted, linux, ARM64, ci]
#- self-hosted
timeout-minutes: 100
steps:
- name: Set up Go 1.19
uses: actions/setup-go@v1
with:
go-version: 1.19.3
id: go
- uses: actions/checkout@v2
with:
path: src/github.com/goharbor/harbor-arm
- name: setup env
run: |
cd src/github.com/goharbor/harbor-arm
sudo make download
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-arm/tests/private_key.pem" >> $GITHUB_ENV
IP=`hostname -I | awk '{print $1}'`
echo "IP=$IP" >> $GITHUB_ENV
shell: bash
- name: install
run: |
cd src/github.com/goharbor/harbor-arm/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 $ARCH
- name: script
run: |
cd src/github.com/goharbor/harbor-arm/src/github.com/goharbor/harbor
bash ./tests/ci/clean.sh $PWD
echo IP: $IP
df -h
bash ./tests/showtime.sh ./tests/ci/api_run.sh PROXY_CACHE $IP
df -h
- name: clean
run: |
set -x
cd src/github.com/goharbor/harbor-arm
bash ./tests/ci/clean.sh

APITEST_LDAP:
env:
APITEST_LDAP: true
runs-on: [self-hosted, linux, ARM64, ci]
#- self-hosted
timeout-minutes: 100
steps:
- name: Set up Go 1.19
uses: actions/setup-go@v1
with:
go-version: 1.19.3
id: go
- uses: actions/checkout@v2
with:
path: src/github.com/goharbor/harbor-arm
- name: setup env
run: |
cd src/github.com/goharbor/harbor-arm
sudo make download
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-arm/tests/private_key.pem" >> $GITHUB_ENV
IP=`hostname -I | awk '{print $1}'`
echo "IP=$IP" >> $GITHUB_ENV
shell: bash

- name: install
run: |
cd src/github.com/goharbor/harbor-arm/src/github.com/goharbor/harbor
env
df -h
bash ./tests/showtime.sh ./tests/ci/api_common_install.sh $IP LDAP $ARCH
- name: script
run: |
echo IP: $IP
df -h
cd src/github.com/goharbor/harbor-arm/src/github.com/goharbor/harbor
bash ./tests/showtime.sh ./tests/ci/api_run.sh LDAP $IP
df -h
- name: clean
run: |
set -x
cd src/github.com/goharbor/harbor-arm
bash ./tests/ci/clean.sh

OFFLINE:
env:
OFFLINE: true
runs-on: [self-hosted, linux, ARM64, ci]
#- self-hosted
timeout-minutes: 100
steps:
- name: Set up Go 1.15
uses: actions/setup-go@v1
with:
go-version: 1.15.12
id: go
- uses: actions/checkout@v2
with:
path: src/github.com/goharbor/harbor-arm
- name: setup env
run: |
cd src/github.com/goharbor/harbor-arm
sudo make download
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-arm/tests/private_key.pem" >> $GITHUB_ENV
shell: bash
- name: before_install
run: |
set -x
cd src/github.com/goharbor/harbor-arm
pwd
env
df -h
#sudo apt install -y xvfb
#xvfb-run ls
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-arm/src/github.com/goharbor/harbor
bash ./tests/showtime.sh ./tests/ci/distro_installer.sh $ARCH
df -h
- name: clean
run: |
set -x
cd src/github.com/goharbor/harbor-arm
bash ./tests/ci/clean.sh

UI_UT:
env:
UI_UT: true
runs-on: [self-hosted, linux, ARM64, ci]
#- self-hosted
timeout-minutes: 100
steps:
- uses: actions/setup-node@v1
with:
node-version: '16.15.0'
- uses: actions/checkout@v2
with:
path: src/github.com/goharbor/harbor-arm
- name: script
run: |
echo IP: $IP
df -h
cd src/github.com/goharbor/harbor-arm
sudo make download
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@v1
with:
file: ./src/github.com/goharbor/harbor-arm/src/github.com/goharbor/harbor/src/portal/coverage/lcov.info
flags: unittests
- name: clean
run: |
set -x
cd src/github.com/goharbor/harbor-arm
bash ./tests/ci/clean.sh
Loading