From 9f19ad8b2c1973da6aa3a83b392839c9a3fddb04 Mon Sep 17 00:00:00 2001 From: Nick Neisen Date: Tue, 10 Oct 2023 22:02:57 -0600 Subject: [PATCH 1/2] Fix cross builds --- core/helpers_unsupported.go | 2 +- core/imagefs.go | 19 +++++++++++++++++++ core/security_context_windows.go | 4 ++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/core/helpers_unsupported.go b/core/helpers_unsupported.go index 6eb1fa7a4..70c2d50a3 100644 --- a/core/helpers_unsupported.go +++ b/core/helpers_unsupported.go @@ -34,7 +34,7 @@ func DefaultMemorySwap() int64 { } func (ds *dockerService) getSecurityOpts( - seccompProfile string, + seccompProfile *runtimeapi.SecurityProfile, separator rune, ) ([]string, error) { logrus.Info("getSecurityOpts is unsupported in this build") diff --git a/core/imagefs.go b/core/imagefs.go index ecf351eb9..49785bd74 100644 --- a/core/imagefs.go +++ b/core/imagefs.go @@ -1,3 +1,22 @@ +//go:build linux || windows +// +build linux windows + +/* +Copyright 2021 Mirantis + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + package core import ( diff --git a/core/security_context_windows.go b/core/security_context_windows.go index 71f93ed6b..ed4087d3a 100644 --- a/core/security_context_windows.go +++ b/core/security_context_windows.go @@ -26,10 +26,10 @@ import ( ) func (ds *dockerService) getSecurityOpts( - seccompProfile string, + seccompProfile *v1.SecurityProfile, separator rune, ) ([]string, error) { - if seccompProfile != "" { + if seccompProfile != nil { logrus.Info("seccomp annotations are not supported on windows") } return nil, nil From 063b6536b3e0b873a3d365b31161e75d6f24899e Mon Sep 17 00:00:00 2001 From: Nick Neisen Date: Tue, 10 Oct 2023 22:03:04 -0600 Subject: [PATCH 2/2] Add CI jobs --- .github/workflows/ci.yml | 61 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..72cf22b9d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,61 @@ +name: CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + + build-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.20' + + - name: Build + run: make static-linux + + build-windows: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.20' + + - name: Build + run: make cross-win + + build-mac: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.20' + + - name: Build + run: make cross-mac + + build-arm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.20' + + - name: Build + run: make cross-arm