]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
CI: prepare Docker image more like GitHub runner
authorMatthew Newton <matthew-git@newtoncomputing.co.uk>
Wed, 12 Oct 2022 22:54:22 +0000 (23:54 +0100)
committerMatthew Newton <matthew-git@newtoncomputing.co.uk>
Thu, 13 Oct 2022 21:18:38 +0000 (22:18 +0100)
.github/actions/docker-prep/action.yml [new file with mode: 0644]
.github/workflows/ci.yml

diff --git a/.github/actions/docker-prep/action.yml b/.github/actions/docker-prep/action.yml
new file mode 100644 (file)
index 0000000..c56ed11
--- /dev/null
@@ -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 "*"
index 2247b24a3972d8cc1c76a58b07d197f8f6543f09..f496e5afafcd5392f68f7c3fe54f740eab9b9495 100644 (file)
@@ -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