From 0c77d89bfcd23a9b514a42e4d5d170396e4b5d27 Mon Sep 17 00:00:00 2001 From: Hollow Man Date: Tue, 14 Mar 2023 18:54:05 +0200 Subject: [PATCH 1/9] add cross compilation for mac m1 Signed-off-by: Hollow Man --- .../workflows/b-binary-build-and-e2e-tests.yaml | 17 +++++++++++++---- .github/workflows/c-create-release.yaml | 3 +++ .krew.yaml | 6 ++++++ Makefile | 6 ++++++ build.py | 5 ++++- 5 files changed, 32 insertions(+), 5 deletions(-) diff --git a/.github/workflows/b-binary-build-and-e2e-tests.yaml b/.github/workflows/b-binary-build-and-e2e-tests.yaml index a9f25448..448bb99a 100644 --- a/.github/workflows/b-binary-build-and-e2e-tests.yaml +++ b/.github/workflows/b-binary-build-and-e2e-tests.yaml @@ -61,10 +61,17 @@ jobs: name: Create cross-platform build env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GOARCH: ${{ matrix.arch }} runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-20.04, macos-latest, windows-latest] + arch: ["", arm64] + exclude: + - os: windows-latest + arch: arm64 + - os: ubuntu-20.04 + arch: arm64 steps: - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # ratchet:actions/checkout@v3 @@ -122,14 +129,16 @@ jobs: if: matrix.os == 'macos-latest' - name: Install libgit2 (Linux/macOS) - run: make libgit2 + run: make libgit2${{ matrix.arch }} if: matrix.os != 'windows-latest' - name: Test core pkg run: go test "-tags=static,gitenabled" -v ./... + if: matrix.arch == '' - name: Test httphandler pkg run: cd httphandler && go test "-tags=static,gitenabled" -v ./... + if: matrix.arch == '' - name: Build env: @@ -143,7 +152,7 @@ jobs: RELEASE: ${{ inputs.RELEASE }} KUBESCAPE_SKIP_UPDATE_CHECK: "true" run: python3 smoke_testing/init.py ${PWD}/build/kubescape-${{ matrix.os }} - if: matrix.os != 'ubuntu-20.04' + if: matrix.os != 'ubuntu-20.04' && matrix.arch == '' - name: Smoke Testing (Linux) env: @@ -165,7 +174,7 @@ jobs: name: Upload artifact (Linux) if: matrix.os == 'ubuntu-20.04' with: - name: kubescape-ubuntu-latest + name: kubescape${{ matrix.arch }}-ubuntu-latest path: build/ if-no-files-found: error @@ -173,7 +182,7 @@ jobs: name: Upload artifact (MacOS, Win) if: matrix.os != 'ubuntu-20.04' with: - name: kubescape-${{ matrix.os }} + name: kubescape${{ matrix.arch }}-${{ matrix.os }} path: build/ if-no-files-found: error diff --git a/.github/workflows/c-create-release.yaml b/.github/workflows/c-create-release.yaml index 325ba664..b35793e0 100644 --- a/.github/workflows/c-create-release.yaml +++ b/.github/workflows/c-create-release.yaml @@ -57,3 +57,6 @@ jobs: ./kubescape-${{ env.WINDOWS_OS }}/kubescape-${{ env.WINDOWS_OS }} ./kubescape-${{ env.WINDOWS_OS }}/kubescape-${{ env.WINDOWS_OS }}.sha256 ./kubescape-${{ env.WINDOWS_OS }}/kubescape-${{ env.WINDOWS_OS }}.tar.gz + ./kubescapearm64-${{ env.MAC_OS }}/kubescape-arm64-${{ env.MAC_OS }} + ./kubescapearm64-${{ env.MAC_OS }}/kubescape-arm64-${{ env.MAC_OS }}.sha256 + ./kubescapearm64-${{ env.MAC_OS }}/kubescape-arm64-${{ env.MAC_OS }}.tar.gz diff --git a/.krew.yaml b/.krew.yaml index 8405da8e..bc831896 100644 --- a/.krew.yaml +++ b/.krew.yaml @@ -16,6 +16,12 @@ spec: arch: amd64 {{ addURIAndSha "https://github.com/kubescape/kubescape/releases/download/{{ .TagName }}/kubescape-macos-latest.tar.gz" .TagName }} bin: kubescape + - selector: + matchLabels: + os: darwin + arch: arm64 + {{ addURIAndSha "https://github.com/kubescape/kubescape/releases/download/{{ .TagName }}/kubescape-arm64-macos-latest.tar.gz" .TagName }} + bin: kubescape - selector: matchLabels: os: linux diff --git a/Makefile b/Makefile index 4801e37d..a885c0d1 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,12 @@ libgit2: -git submodule update --init --recursive cd git2go; make install-static +# build and install libgit2 for macOS m1 +libgit2arm64: + git submodule update --init --recursive + sed -i '' 's/cmake -D/cmake -DCMAKE_OSX_ARCHITECTURES="arm64" -D/' git2go/script/build-libgit2.sh + cd git2go; make install-static + # go build tags TAGS = "gitenabled,static" diff --git a/build.py b/build.py index f1ccb765..b232acfa 100644 --- a/build.py +++ b/build.py @@ -27,7 +27,10 @@ def get_build_dir(): def get_package_name(): if CURRENT_PLATFORM not in platformSuffixes: raise OSError("Platform %s is not supported!" % (CURRENT_PLATFORM)) - return "kubescape-" + platformSuffixes[CURRENT_PLATFORM] + package_name = "kubescape-" + if os.getenv("GOARCH"): + package_name += os.getenv("GOARCH") + "-" + return package_name + platformSuffixes[CURRENT_PLATFORM] def main(): From 3238555df3afbb5488312bf747c897b18bbbacaf Mon Sep 17 00:00:00 2001 From: Hollow Man Date: Tue, 14 Mar 2023 21:18:55 +0200 Subject: [PATCH 2/9] add cross compilation for ubuntu arm64 Signed-off-by: Hollow Man --- .../b-binary-build-and-e2e-tests.yaml | 32 +++++++++++++------ .github/workflows/c-create-release.yaml | 3 ++ .krew.yaml | 6 ++++ Makefile | 4 ++- 4 files changed, 35 insertions(+), 10 deletions(-) diff --git a/.github/workflows/b-binary-build-and-e2e-tests.yaml b/.github/workflows/b-binary-build-and-e2e-tests.yaml index 448bb99a..554d44d1 100644 --- a/.github/workflows/b-binary-build-and-e2e-tests.yaml +++ b/.github/workflows/b-binary-build-and-e2e-tests.yaml @@ -70,8 +70,6 @@ jobs: exclude: - os: windows-latest arch: arm64 - - os: ubuntu-20.04 - arch: arm64 steps: - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # ratchet:actions/checkout@v3 @@ -119,6 +117,22 @@ jobs: go-version: ${{ inputs.GO_VERSION }} cache: true + - name: start ${{ matrix.arch }} environment in container + run: | + sudo apt-get install -y binfmt-support qemu-user-static + sudo docker run --platform linux/${{ matrix.arch }} -e RELEASE=${{ inputs.RELEASE }} \ + -e CLIENT=${{ inputs.CLIENT }} -e CGO_ENABLED=${{ inputs.CGO_ENABLED }} \ + -e KUBESCAPE_SKIP_UPDATE_CHECK=true -v ${PWD}:/work -w /work \ + -v ~/go/pkg/mod:/root/go/pkg/mod -v ~/.cache/go-build:/root/.cache/go-build \ + -d --name build golang:${{ inputs.GO_VERSION }}-bullseye sleep 21600 + sudo docker ps + DOCKER_CMD="sudo docker exec build" + ${DOCKER_CMD} apt update + ${DOCKER_CMD} apt install -y cmake python3 + ${DOCKER_CMD} git config --global --add safe.directory '*' + echo "DOCKER_CMD=${DOCKER_CMD}" >> $GITHUB_ENV; + if: matrix.os == 'ubuntu-20.04' && matrix.arch != '' + - name: Install MSYS2 & libgit2 (Windows) shell: cmd run: .\build.bat all @@ -129,23 +143,23 @@ jobs: if: matrix.os == 'macos-latest' - name: Install libgit2 (Linux/macOS) - run: make libgit2${{ matrix.arch }} + run: ${{ env.DOCKER_CMD }} make libgit2${{ matrix.arch }} if: matrix.os != 'windows-latest' - name: Test core pkg - run: go test "-tags=static,gitenabled" -v ./... - if: matrix.arch == '' + run: ${{ env.DOCKER_CMD }} go test "-tags=static,gitenabled" -v ./... + if: matrix.os != 'macos-latest' || matrix.arch != 'arm64' - name: Test httphandler pkg - run: cd httphandler && go test "-tags=static,gitenabled" -v ./... - if: matrix.arch == '' + run: ${{ env.DOCKER_CMD }} sh -c 'cd httphandler && go test "-tags=static,gitenabled" -v ./...' + if: matrix.os != 'macos-latest' || matrix.arch != 'arm64' - name: Build env: RELEASE: ${{ inputs.RELEASE }} CLIENT: ${{ inputs.CLIENT }} CGO_ENABLED: ${{ inputs.CGO_ENABLED }} - run: python3 --version && python3 build.py + run: ${{ env.DOCKER_CMD }} python3 --version && ${{ env.DOCKER_CMD }} python3 build.py - name: Smoke Testing (Windows / MacOS) env: @@ -158,7 +172,7 @@ jobs: env: RELEASE: ${{ inputs.RELEASE }} KUBESCAPE_SKIP_UPDATE_CHECK: "true" - run: python3 smoke_testing/init.py ${PWD}/build/kubescape-ubuntu-latest + run: ${{ env.DOCKER_CMD }} python3 smoke_testing/init.py ./build/kubescape-ubuntu-latest if: matrix.os == 'ubuntu-20.04' - name: golangci-lint diff --git a/.github/workflows/c-create-release.yaml b/.github/workflows/c-create-release.yaml index b35793e0..8398e37d 100644 --- a/.github/workflows/c-create-release.yaml +++ b/.github/workflows/c-create-release.yaml @@ -60,3 +60,6 @@ jobs: ./kubescapearm64-${{ env.MAC_OS }}/kubescape-arm64-${{ env.MAC_OS }} ./kubescapearm64-${{ env.MAC_OS }}/kubescape-arm64-${{ env.MAC_OS }}.sha256 ./kubescapearm64-${{ env.MAC_OS }}/kubescape-arm64-${{ env.MAC_OS }}.tar.gz + ./kubescapearm64-${{ env.UBUNTU_OS }}/kubescape-arm64-${{ env.UBUNTU_OS }} + ./kubescapearm64-${{ env.UBUNTU_OS }}/kubescape-arm64-${{ env.UBUNTU_OS }}.sha256 + ./kubescapearm64-${{ env.UBUNTU_OS }}/kubescape-arm64-${{ env.UBUNTU_OS }}.tar.gz diff --git a/.krew.yaml b/.krew.yaml index bc831896..9a8f14cc 100644 --- a/.krew.yaml +++ b/.krew.yaml @@ -28,6 +28,12 @@ spec: arch: amd64 {{ addURIAndSha "https://github.com/kubescape/kubescape/releases/download/{{ .TagName }}/kubescape-ubuntu-latest.tar.gz" .TagName }} bin: kubescape + - selector: + matchLabels: + os: linux + arch: arm64 + {{ addURIAndSha "https://github.com/kubescape/kubescape/releases/download/{{ .TagName }}/kubescape-arm64-ubuntu-latest.tar.gz" .TagName }} + bin: kubescape - selector: matchLabels: os: windows diff --git a/Makefile b/Makefile index a885c0d1..33eda247 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,9 @@ libgit2: # build and install libgit2 for macOS m1 libgit2arm64: git submodule update --init --recursive - sed -i '' 's/cmake -D/cmake -DCMAKE_OSX_ARCHITECTURES="arm64" -D/' git2go/script/build-libgit2.sh + if [ "$(shell uname -s)" = "Darwin" ]; then \ + sed -i '' 's/cmake -D/cmake -DCMAKE_OSX_ARCHITECTURES="arm64" -D/' git2go/script/build-libgit2.sh; \ + fi cd git2go; make install-static # go build tags From c4980262083c84a33a4eef72ba6666fe08ea238c Mon Sep 17 00:00:00 2001 From: Hollow Man Date: Tue, 14 Mar 2023 22:46:48 +0200 Subject: [PATCH 3/9] Disable core pkg test for ubuntu arm64 Signed-off-by: Hollow Man --- .github/workflows/b-binary-build-and-e2e-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/b-binary-build-and-e2e-tests.yaml b/.github/workflows/b-binary-build-and-e2e-tests.yaml index 554d44d1..45a7f56c 100644 --- a/.github/workflows/b-binary-build-and-e2e-tests.yaml +++ b/.github/workflows/b-binary-build-and-e2e-tests.yaml @@ -148,7 +148,7 @@ jobs: - name: Test core pkg run: ${{ env.DOCKER_CMD }} go test "-tags=static,gitenabled" -v ./... - if: matrix.os != 'macos-latest' || matrix.arch != 'arm64' + if: matrix.arch != 'arm64' - name: Test httphandler pkg run: ${{ env.DOCKER_CMD }} sh -c 'cd httphandler && go test "-tags=static,gitenabled" -v ./...' From 9327f70e1a1200b41457cc885a8a39897407020d Mon Sep 17 00:00:00 2001 From: Hollow Man Date: Wed, 15 Mar 2023 09:10:31 +0200 Subject: [PATCH 4/9] Fix naming Signed-off-by: Hollow Man --- .../workflows/b-binary-build-and-e2e-tests.yaml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/b-binary-build-and-e2e-tests.yaml b/.github/workflows/b-binary-build-and-e2e-tests.yaml index 45a7f56c..443c65a4 100644 --- a/.github/workflows/b-binary-build-and-e2e-tests.yaml +++ b/.github/workflows/b-binary-build-and-e2e-tests.yaml @@ -122,8 +122,8 @@ jobs: sudo apt-get install -y binfmt-support qemu-user-static sudo docker run --platform linux/${{ matrix.arch }} -e RELEASE=${{ inputs.RELEASE }} \ -e CLIENT=${{ inputs.CLIENT }} -e CGO_ENABLED=${{ inputs.CGO_ENABLED }} \ - -e KUBESCAPE_SKIP_UPDATE_CHECK=true -v ${PWD}:/work -w /work \ - -v ~/go/pkg/mod:/root/go/pkg/mod -v ~/.cache/go-build:/root/.cache/go-build \ + -e KUBESCAPE_SKIP_UPDATE_CHECK=true -e GOARCH=${{ matrix.arch }} -v ${PWD}:/work \ + -w /work -v ~/go/pkg/mod:/root/go/pkg/mod -v ~/.cache/go-build:/root/.cache/go-build \ -d --name build golang:${{ inputs.GO_VERSION }}-bullseye sleep 21600 sudo docker ps DOCKER_CMD="sudo docker exec build" @@ -168,12 +168,19 @@ jobs: run: python3 smoke_testing/init.py ${PWD}/build/kubescape-${{ matrix.os }} if: matrix.os != 'ubuntu-20.04' && matrix.arch == '' - - name: Smoke Testing (Linux) + - name: Smoke Testing (Linux amd64) env: RELEASE: ${{ inputs.RELEASE }} KUBESCAPE_SKIP_UPDATE_CHECK: "true" - run: ${{ env.DOCKER_CMD }} python3 smoke_testing/init.py ./build/kubescape-ubuntu-latest - if: matrix.os == 'ubuntu-20.04' + run: ${{ env.DOCKER_CMD }} python3 smoke_testing/init.py ${PWD}/build/kubescape-ubuntu-latest + if: matrix.os == 'ubuntu-20.04' && matrix.arch == '' + + - name: Smoke Testing (Linux ${{ matrix.arch }}) + env: + RELEASE: ${{ inputs.RELEASE }} + KUBESCAPE_SKIP_UPDATE_CHECK: "true" + run: ${{ env.DOCKER_CMD }} python3 smoke_testing/init.py ./build/kubescape-${{ matrix.arch }}-ubuntu-latest + if: matrix.os == 'ubuntu-20.04' && matrix.arch != '' - name: golangci-lint if: matrix.os == 'ubuntu-20.04' From d02f15ef6fe89bfdca727e59fba75ffde015a945 Mon Sep 17 00:00:00 2001 From: Hollow Man Date: Tue, 21 Mar 2023 14:33:12 +0200 Subject: [PATCH 5/9] merge pr scanner build into binary-build-and-e2e-tests Signed-off-by: Hollow Man --- .github/workflows/a-pr-scanner.yaml | 93 +++-------------------------- 1 file changed, 8 insertions(+), 85 deletions(-) diff --git a/.github/workflows/a-pr-scanner.yaml b/.github/workflows/a-pr-scanner.yaml index ad368cf6..b68f6743 100644 --- a/.github/workflows/a-pr-scanner.yaml +++ b/.github/workflows/a-pr-scanner.yaml @@ -70,90 +70,13 @@ jobs: reactions: 'eyes' basic-tests: needs: scanners - name: Create cross-platform build - runs-on: ${{ matrix.os }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: ./.github/workflows/b-binary-build-and-e2e-tests.yaml + with: + COMPONENT_NAME: kubescape + CGO_ENABLED: 1 + GO111MODULE: "" + GO_VERSION: "1.19" RELEASE: ${{ inputs.RELEASE }} CLIENT: ${{ inputs.CLIENT }} - strategy: - matrix: - os: [ubuntu-20.04, macos-latest, windows-latest] - steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # ratchet:actions/checkout@v3 - with: - submodules: recursive - - name: Cache Go modules (Linux) - if: matrix.os == 'ubuntu-latest' - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # ratchet:actions/cache@v3 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - name: Cache Go modules (macOS) - if: matrix.os == 'macos-latest' - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # ratchet:actions/cache@v3 - with: - path: | - ~/Library/Caches/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - name: Cache Go modules (Windows) - if: matrix.os == 'windows-latest' - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # ratchet:actions/cache@v3 - with: - path: | - ~\AppData\Local\go-build - ~\go\pkg\mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - name: Set up Go - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # ratchet:actions/setup-go@v3 - with: - go-version: 1.19 - - name: Install MSYS2 & libgit2 (Windows) - shell: cmd - run: .\build.bat all - if: matrix.os == 'windows-latest' - - name: Install pkg-config (macOS) - run: brew install pkg-config - if: matrix.os == 'macos-latest' - - name: Install libgit2 (Linux/macOS) - run: make libgit2 - if: matrix.os != 'windows-latest' - - name: Test core pkg - run: go test "-tags=static,gitenabled" -v ./... - - name: Test httphandler pkg - run: cd httphandler && go test "-tags=static,gitenabled" -v ./... - - name: Build - env: - RELEASE: ${{ inputs.RELEASE }} - CLIENT: ${{ inputs.CLIENT }} - CGO_ENABLED: 1 - run: python3 --version && python3 build.py - - name: Smoke Testing (Windows / MacOS) - env: - RELEASE: ${{ inputs.RELEASE }} - KUBESCAPE_SKIP_UPDATE_CHECK: "true" - run: python3 smoke_testing/init.py ${PWD}/build/kubescape-${{ matrix.os }} - if: matrix.os != 'ubuntu-20.04' - - name: Smoke Testing (Linux) - env: - RELEASE: ${{ inputs.RELEASE }} - KUBESCAPE_SKIP_UPDATE_CHECK: "true" - run: python3 smoke_testing/init.py ${PWD}/build/kubescape-ubuntu-latest - if: matrix.os == 'ubuntu-20.04' - - name: golangci-lint - if: matrix.os == 'ubuntu-20.04' - continue-on-error: true - uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # ratchet:golangci/golangci-lint-action@v3 - with: - version: latest - args: --timeout 10m --build-tags=static - only-new-issues: true + CHECKOUT_REPO: ${{ github.repository }} + secrets: inherit From 48a15e1a8df914a81b33e9c82a306cabd1ea55c5 Mon Sep 17 00:00:00 2001 From: Hollow Man Date: Wed, 22 Mar 2023 23:54:07 +0200 Subject: [PATCH 6/9] Disable multi-platform test with commits Signed-off-by: Hollow Man --- .github/workflows/b-binary-build-and-e2e-tests.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/b-binary-build-and-e2e-tests.yaml b/.github/workflows/b-binary-build-and-e2e-tests.yaml index 443c65a4..2b805631 100644 --- a/.github/workflows/b-binary-build-and-e2e-tests.yaml +++ b/.github/workflows/b-binary-build-and-e2e-tests.yaml @@ -148,11 +148,11 @@ jobs: - name: Test core pkg run: ${{ env.DOCKER_CMD }} go test "-tags=static,gitenabled" -v ./... - if: matrix.arch != 'arm64' + if: "!startsWith(github.ref, 'refs/tags') && matrix.os == 'ubuntu-20.04' && matrix.arch == '' || startsWith(github.ref, 'refs/tags') && matrix.arch != 'arm64'" - name: Test httphandler pkg run: ${{ env.DOCKER_CMD }} sh -c 'cd httphandler && go test "-tags=static,gitenabled" -v ./...' - if: matrix.os != 'macos-latest' || matrix.arch != 'arm64' + if: "!startsWith(github.ref, 'refs/tags') && matrix.os == 'ubuntu-20.04' && matrix.arch == '' || startsWith(github.ref, 'refs/tags') && (matrix.os != 'macos-latest' || matrix.arch != 'arm64')" - name: Build env: @@ -166,7 +166,7 @@ jobs: RELEASE: ${{ inputs.RELEASE }} KUBESCAPE_SKIP_UPDATE_CHECK: "true" run: python3 smoke_testing/init.py ${PWD}/build/kubescape-${{ matrix.os }} - if: matrix.os != 'ubuntu-20.04' && matrix.arch == '' + if: startsWith(github.ref, 'refs/tags') && matrix.os != 'ubuntu-20.04' && matrix.arch == '' - name: Smoke Testing (Linux amd64) env: @@ -180,7 +180,7 @@ jobs: RELEASE: ${{ inputs.RELEASE }} KUBESCAPE_SKIP_UPDATE_CHECK: "true" run: ${{ env.DOCKER_CMD }} python3 smoke_testing/init.py ./build/kubescape-${{ matrix.arch }}-ubuntu-latest - if: matrix.os == 'ubuntu-20.04' && matrix.arch != '' + if: startsWith(github.ref, 'refs/tags') && matrix.os == 'ubuntu-20.04' && matrix.arch != '' - name: golangci-lint if: matrix.os == 'ubuntu-20.04' From e8d92ffd43bab1c1e375e145b8f8e690b1052af3 Mon Sep 17 00:00:00 2001 From: Hollow Man Date: Thu, 23 Mar 2023 01:39:26 +0200 Subject: [PATCH 7/9] Resume test core pkg under ubuntu arm64 Signed-off-by: Hollow Man --- .github/workflows/b-binary-build-and-e2e-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/b-binary-build-and-e2e-tests.yaml b/.github/workflows/b-binary-build-and-e2e-tests.yaml index 2b805631..4edfc12e 100644 --- a/.github/workflows/b-binary-build-and-e2e-tests.yaml +++ b/.github/workflows/b-binary-build-and-e2e-tests.yaml @@ -148,7 +148,7 @@ jobs: - name: Test core pkg run: ${{ env.DOCKER_CMD }} go test "-tags=static,gitenabled" -v ./... - if: "!startsWith(github.ref, 'refs/tags') && matrix.os == 'ubuntu-20.04' && matrix.arch == '' || startsWith(github.ref, 'refs/tags') && matrix.arch != 'arm64'" + if: "!startsWith(github.ref, 'refs/tags') && matrix.os == 'ubuntu-20.04' && matrix.arch == '' || startsWith(github.ref, 'refs/tags') && (matrix.os != 'macos-latest' || matrix.arch != 'arm64')" - name: Test httphandler pkg run: ${{ env.DOCKER_CMD }} sh -c 'cd httphandler && go test "-tags=static,gitenabled" -v ./...' From 6d7a89bb743f2f55b5d42811f53b336cbb4d8bdc Mon Sep 17 00:00:00 2001 From: Hollow Man Date: Sat, 25 Mar 2023 14:12:32 +0200 Subject: [PATCH 8/9] Add ARM64 binary installation Signed-off-by: Hollow Man --- install.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 48295ab3..adb994cb 100755 --- a/install.sh +++ b/install.sh @@ -28,10 +28,20 @@ else osName=ubuntu fi +arch=$(uname -m) +if [[ $arch == *"aarch64"* ]]; then + arch="-arm64" +else + if [[ $arch != *"x86_64"* ]]; then + echo -e "\033[33mArchitecture $arch may be unsupported, will try to install the amd64 one anyway." + fi + arch="" +fi + mkdir -p $BASE_DIR OUTPUT=$BASE_DIR/$KUBESCAPE_EXEC -DOWNLOAD_URL="https://github.com/kubescape/kubescape/releases/${RELEASE}/kubescape-${osName}-latest" +DOWNLOAD_URL="https://github.com/kubescape/kubescape/releases/${RELEASE}/kubescape${arch}-${osName}-latest" curl --progress-bar -L $DOWNLOAD_URL -o $OUTPUT From 03f792e968174fb5972fc9fd83180423fb35396f Mon Sep 17 00:00:00 2001 From: Hollow Man Date: Thu, 20 Apr 2023 11:21:34 +0300 Subject: [PATCH 9/9] Revert change to install.sh Signed-off-by: Hollow Man --- install.sh | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/install.sh b/install.sh index adb994cb..48295ab3 100755 --- a/install.sh +++ b/install.sh @@ -28,20 +28,10 @@ else osName=ubuntu fi -arch=$(uname -m) -if [[ $arch == *"aarch64"* ]]; then - arch="-arm64" -else - if [[ $arch != *"x86_64"* ]]; then - echo -e "\033[33mArchitecture $arch may be unsupported, will try to install the amd64 one anyway." - fi - arch="" -fi - mkdir -p $BASE_DIR OUTPUT=$BASE_DIR/$KUBESCAPE_EXEC -DOWNLOAD_URL="https://github.com/kubescape/kubescape/releases/${RELEASE}/kubescape${arch}-${osName}-latest" +DOWNLOAD_URL="https://github.com/kubescape/kubescape/releases/${RELEASE}/kubescape-${osName}-latest" curl --progress-bar -L $DOWNLOAD_URL -o $OUTPUT