From e58e791b13884def482943e1ca32781169aa267e Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Tue, 24 Sep 2024 19:53:57 -0700 Subject: [PATCH] Use composite action for setup-musl-gcc (#829) --- .github/actions/setup-musl-gcc/action.yml | 13 +++++++++++++ .github/workflows/build-helper.yml | 9 ++------- .github/workflows/codeql.yml | 7 +------ 3 files changed, 16 insertions(+), 13 deletions(-) create mode 100644 .github/actions/setup-musl-gcc/action.yml 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