From 7d89f03faa9db8e74c3ed47f305251432dc1b3ff Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Sat, 16 Sep 2023 14:07:59 -0400 Subject: [PATCH] ci: use the `docker run` pattern for the generic-package job so now we do the same thing for all the packaging jobs. Also set up a git 'safe.directory' config in the `test-gem-build` script to avoid the fatal: detected dubious ownership in repository" errors from git. --- .github/workflows/ci.yml | 10 ++++++---- scripts/test-gem-build | 3 +++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4acc46bc0a9..ddffe489be2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -401,18 +401,20 @@ jobs: needs: ["rcd_image_version"] name: "generic-package" runs-on: ubuntu-latest - container: - image: "ghcr.io/rake-compiler/rake-compiler-dock-image:${{needs.rcd_image_version.outputs.rcd_image_version}}-mri-x86_64-linux" steps: - uses: actions/checkout@v4 with: submodules: true - - run: git config --global --add safe.directory /__w/nokogiri/nokogiri # shrug - uses: actions/cache@v3 with: path: ports/archives key: tarballs-ubuntu-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}} - - run: ./scripts/test-gem-build gems ruby + - env: + DOCKER_IMAGE: "ghcr.io/rake-compiler/rake-compiler-dock-image:${{needs.rcd_image_version.outputs.rcd_image_version}}-mri-x86_64-linux" + run: | + docker run --rm -v "$(pwd):/nokogiri" -w /nokogiri \ + ${DOCKER_IMAGE} \ + ./scripts/test-gem-build gems ruby - uses: actions/upload-artifact@v3 with: name: generic-gem diff --git a/scripts/test-gem-build b/scripts/test-gem-build index 2fd356711db..3df73f038ab 100755 --- a/scripts/test-gem-build +++ b/scripts/test-gem-build @@ -16,6 +16,9 @@ test -e /etc/os-release && cat /etc/os-release set -u -x +# avoid the pernicious "fatal: detected dubious ownership in repository" errors +git config --global --add safe.directory $(realpath $(dirname $0)/..) + bundle bundle exec rake set-version-to-timestamp