diff --git a/.github/workflows/darwin-tests.yaml b/.github/workflows/darwin-tests.yaml new file mode 100644 index 0000000000..5a83add32d --- /dev/null +++ b/.github/workflows/darwin-tests.yaml @@ -0,0 +1,25 @@ +on: + pull_request: + types: + - opened + - edited + - reopened + - synchronize + +name: Darwin tests +jobs: + test: + strategy: + matrix: + go-version: [1.16.x, 1.17.x] + os: [macos-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: Checkout code + uses: actions/checkout@v2 + - name: Build utils + run: ./ci/darwin-test.sh diff --git a/ci/darwin-test.sh b/ci/darwin-test.sh new file mode 100755 index 0000000000..92317653be --- /dev/null +++ b/ci/darwin-test.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2022 Apple Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +set -e + +cidir=$(dirname "$0") +runtimedir=$cidir/../src/runtime + +build_working_packages() { + # working packages: + device_api=$runtimedir/virtcontainers/device/api + device_config=$runtimedir/virtcontainers/device/config + device_drivers=$runtimedir/virtcontainers/device/drivers + device_manager=$runtimedir/virtcontainers/device/manager + rc_pkg_dir=$runtimedir/pkg/resourcecontrol/ + utils_pkg_dir=$runtimedir/virtcontainers/utils + + # broken packages :( : + #katautils=$runtimedir/pkg/katautils + #oci=$runtimedir/pkg/oci + #vc=$runtimedir/virtcontainers + + pkgs=( + "$device_api" + "$device_config" + "$device_drivers" + "$device_manager" + "$utils_pkg_dir" + "$rc_pkg_dir") + for pkg in "${pkgs[@]}"; do + echo building "$pkg" + pushd "$pkg" &>/dev/null + go build + go test + popd &>/dev/null + done +} + +build_working_packages