mirror of
https://github.com/containers/skopeo.git
synced 2025-06-26 14:52:36 +00:00
Merge pull request #2344 from cevich/cross_on_pool
Execute cross-build task using PW pool
This commit is contained in:
commit
77bb7e44a1
41
.cirrus.yml
41
.cirrus.yml
@ -81,20 +81,33 @@ osx_task:
|
|||||||
$CIRRUS_CHANGE_TITLE !=~ '.*CI:DOCS.*'
|
$CIRRUS_CHANGE_TITLE !=~ '.*CI:DOCS.*'
|
||||||
depends_on:
|
depends_on:
|
||||||
- validate
|
- validate
|
||||||
macos_instance:
|
persistent_worker: &mac_pw
|
||||||
image: ghcr.io/cirruslabs/macos-ventura-base:latest
|
labels:
|
||||||
setup_script: |
|
os: darwin
|
||||||
export PATH=$GOPATH/bin:$PATH
|
arch: arm64
|
||||||
brew update
|
purpose: prod
|
||||||
brew install gpgme go go-md2man
|
env:
|
||||||
make tools
|
CIRRUS_WORKING_DIR: "$HOME/ci/task-${CIRRUS_TASK_ID}"
|
||||||
test_script: |
|
# Prevent cache-pollution fron one task to the next.
|
||||||
export PATH=$GOPATH/bin:$PATH
|
GOPATH: "$CIRRUS_WORKING_DIR/.go"
|
||||||
go version
|
GOCACHE: "$CIRRUS_WORKING_DIR/.go/cache"
|
||||||
go env
|
GOENV: "$CIRRUS_WORKING_DIR/.go/support"
|
||||||
make validate-local test-unit-local bin/skopeo
|
GOSRC: "$HOME/ci/task-${CIRRUS_TASK_ID}"
|
||||||
sudo make install
|
TMPDIR: "/private/tmp/ci"
|
||||||
/usr/local/bin/skopeo -v
|
# This host is/was shared with potentially many other CI tasks.
|
||||||
|
# The previous task may have been canceled or aborted.
|
||||||
|
prep_script: &mac_cleanup "contrib/cirrus/mac_cleanup.sh"
|
||||||
|
test_script:
|
||||||
|
- export PATH=$GOPATH/bin:$PATH
|
||||||
|
- go version
|
||||||
|
- go env
|
||||||
|
- make tools
|
||||||
|
- make validate-local test-unit-local bin/skopeo
|
||||||
|
- bin/skopeo -v
|
||||||
|
# This host is/was shared with potentially many other CI tasks.
|
||||||
|
# Ensure nothing is left running while waiting for the next task.
|
||||||
|
always:
|
||||||
|
task_cleanup_script: *mac_cleanup
|
||||||
|
|
||||||
|
|
||||||
cross_task:
|
cross_task:
|
||||||
|
40
contrib/cirrus/mac_cleanup.sh
Executable file
40
contrib/cirrus/mac_cleanup.sh
Executable file
@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This script is intended to be called by Cirrus-CI on a Mac M1 persistent worker.
|
||||||
|
# It performs a best-effort attempt at cleaning up from one task execution to the next.
|
||||||
|
# Since it run both before and after tasks, it must exit cleanly if there was a cleanup
|
||||||
|
# failure (i.e. file or directory not found).
|
||||||
|
|
||||||
|
# Help anybody debugging side-effects, since failures are ignored (by necessity).
|
||||||
|
set +e -x
|
||||||
|
|
||||||
|
# These are the main processes which could leak out of testing.
|
||||||
|
killall podman vfkit gvproxy make go ginkgo
|
||||||
|
|
||||||
|
mkdir -p $TMPDIR
|
||||||
|
|
||||||
|
# Golang will leave behind lots of read-only bits, ref:
|
||||||
|
# https://go.dev/ref/mod#module-cache
|
||||||
|
# However other tools/scripts could also set things read-only.
|
||||||
|
# At this point in CI, we really want all this stuff gone-gone,
|
||||||
|
# so there's actually zero-chance it can interfere.
|
||||||
|
chmod -R u+w $TMPDIR/* $TMPDIR/.??*
|
||||||
|
|
||||||
|
# This is defined as $TMPDIR during setup. Name must be kept
|
||||||
|
# "short" as sockets may reside here. Darwin suffers from
|
||||||
|
# the same limited socket-pathname character-length restriction
|
||||||
|
# as Linux.
|
||||||
|
rm -rf $TMPDIR/* $TMPDIR/.??*
|
||||||
|
|
||||||
|
# Don't change or clobber anything under $CIRRUS_WORKING_DIR for
|
||||||
|
# the currently running task. But make sure we have write permission
|
||||||
|
# (go get sets dependencies ro) for everything else, before removing it.
|
||||||
|
# First make everything writeable - see the "Golang will..." comment above.
|
||||||
|
# shellcheck disable=SC2154
|
||||||
|
find "$HOME/ci" -mindepth 1 -maxdepth 1 \
|
||||||
|
-not -name "*task-${CIRRUS_TASK_ID}*" -prune -exec chmod -R u+w '{}' +
|
||||||
|
find "$HOME/ci" -mindepth 1 -maxdepth 1 \
|
||||||
|
-not -name "*task-${CIRRUS_TASK_ID}*" -prune -exec rm -rf '{}' +
|
||||||
|
|
||||||
|
# Bash scripts exit with the status of the last command.
|
||||||
|
true
|
Loading…
Reference in New Issue
Block a user