From: Matthew Newton Date: Wed, 12 Oct 2022 22:54:22 +0000 (+0100) Subject: CI: prepare Docker image more like GitHub runner X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4fa25354eba3809fc155fd666ae3023f52a1bbd7;p=thirdparty%2Ffreeradius-server.git CI: prepare Docker image more like GitHub runner --- diff --git a/.github/actions/docker-prep/action.yml b/.github/actions/docker-prep/action.yml new file mode 100644 index 00000000000..c56ed1153e6 --- /dev/null +++ b/.github/actions/docker-prep/action.yml @@ -0,0 +1,43 @@ +name: docker-prep + +runs: + using: composite + + steps: + + - name: Self-hosted runner Docker container fixes + shell: bash + run: ln -fs /usr/bin/env /usr/local/bin/sudo + + - name: Install extra build dependencies needed in Docker + shell: bash + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + ca-certificates \ + curl \ + gawk \ + git \ + git-lfs \ + gnupg \ + lsb-release \ + software-properties-common \ + wget + + - name: Set up Toolchain repository + shell: bash + run: sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + + - name: Update repositories + shell: bash + run: sudo apt-get update + + # + # git doesn't like the fact we're running as root but some + # directories are owned by the docker user ID. We could try + # and add the correct directories individually, but it really + # doesn't matter inside an ephemeral container. + # + - name: Fix git dubious ownership issue + shell: bash + run: git config --global --add safe.directory "*" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2247b24a397..f496e5afafc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -139,11 +139,21 @@ jobs: steps: + # Need git installed for checkout to behave normally + - name: Install checkout prerequisites + run: apt-get update && apt-get install -y --no-install-recommends git ca-certificates + # Checkout, but defer pulling LFS objects until we've restored the cache - uses: actions/checkout@v2 with: lfs: false + # Docker image does not have same environment as the + # standard GitHub actions image, so use this to bring them + # more in line. + - name: Prepare Docker environment + uses: ./.github/actions/docker-prep + - name: Create LFS file list as cache key run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id