diff --git a/.github/actions/setup-musl-gcc/action.yml b/.github/actions/setup-musl-gcc/action.yml new file mode 100644 index 000000000..bbf2986b2 --- /dev/null +++ b/.github/actions/setup-musl-gcc/action.yml @@ -0,0 +1,13 @@ +name: "Setup musl-gcc" +description: "Compile and install musl-gcc from source" + +runs: + using: "composite" + steps: + - run: | + git clone https://git.musl-libc.org/git/musl + cd musl + ./configure + make + sudo make install + shell: bash diff --git a/.github/workflows/build-helper.yml b/.github/workflows/build-helper.yml index 0dcc517c1..de7240a3b 100644 --- a/.github/workflows/build-helper.yml +++ b/.github/workflows/build-helper.yml @@ -37,17 +37,12 @@ jobs: if: matrix.platform == 'linux' run: | sudo apt-get update - sudo apt-get install --no-install-recommends -y libarchive-tools libopenjp2-tools rpm squashfs-tools build-essential + sudo apt-get install --no-install-recommends -y libarchive-tools libopenjp2-tools rpm squashfs-tools # We use musl-gcc instead of glibc for cgo compilation as it is more-easily statically linked - name: Setup musl-gcc (Linux only) if: matrix.platform == 'linux' - run: | - git clone https://git.musl-libc.org/git/musl - cd musl - ./configure - make - sudo make install + uses: ./.github/actions/setup-musl-gcc # The pre-installed version of the AWS CLI has a segfault problem so we'll install it via Homebrew instead. - name: Upgrade AWS CLI (Mac only) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 5a7ebf032..77f778d32 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -74,12 +74,7 @@ jobs: # We use musl-gcc instead of glibc for cgo compilation as it is more-easily statically linked - name: Setup musl-gcc (Go only) if: matrix.language == 'go' - run: | - git clone https://git.musl-libc.org/git/musl - cd musl - ./configure - make - sudo make install + uses: ./.github/actions/setup-musl-gcc # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL