From 46ea21b4afade19f27bba4e393f73c9902472118 Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Mon, 30 Sep 2024 15:55:30 -0400 Subject: [PATCH] change workflow to pick libc --- .github/actions/build-test-image/action.yml | 8 ++-- .github/actions/install-cairo/action.yml | 43 +++++++++++++-------- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/.github/actions/build-test-image/action.yml b/.github/actions/build-test-image/action.yml index d47754333..b871f9dc1 100644 --- a/.github/actions/build-test-image/action.yml +++ b/.github/actions/build-test-image/action.yml @@ -22,6 +22,10 @@ inputs: runs: using: composite steps: + - name: Install Cairo + uses: ./.github/actions/install-cairo + with: + use_musl_libc: "true" - name: Check if image exists id: check-image uses: smartcontractkit/chainlink-github-actions/docker/image-exists@fc3e0df622521019f50d772726d6bf8dc919dd38 # v2.3.19 @@ -30,10 +34,6 @@ runs: tag: ${{ inputs.tag }} AWS_REGION: ${{ inputs.QA_AWS_REGION }} AWS_ROLE_TO_ASSUME: ${{ inputs.QA_AWS_ROLE_TO_ASSUME }} - - name: Checkout sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: Install Cairo - uses: ./.github/actions/install-cairo - name: Build and Publish Test Runner if: steps.check-image.outputs.exists == 'false' uses: smartcontractkit/chainlink-github-actions/docker/build-push@fc3e0df622521019f50d772726d6bf8dc919dd38 # v2.3.19 diff --git a/.github/actions/install-cairo/action.yml b/.github/actions/install-cairo/action.yml index cae079e10..5e994cf0f 100644 --- a/.github/actions/install-cairo/action.yml +++ b/.github/actions/install-cairo/action.yml @@ -2,34 +2,43 @@ name: Install Cairo and Scarb description: A composite action that installs cairo and scarb binaries inputs: - cairo_version: - description: Cairo release version - default: "v2.8.2" - required: false + # cairo_version: + # description: Cairo release version + # default: "v2.8.2" + # required: false scarb_version: description: Scarb release version default: "v2.8.2" required: false + use_musl_libc: + description: "C library implementation" + default: "false" + required: false runs: using: composite steps: - - name: Setup Cairo for Linux - id: install-cairo - shell: bash - run: | - wget https://github.com/starkware-libs/cairo/releases/download/${{ inputs.cairo_version }}/release-x86_64-unknown-linux-musl.tar.gz - tar -xvzf release-x86_64-unknown-linux-musl.tar.gz - mv -vf cairo cairo-build - echo "$GITHUB_WORKSPACE/cairo-build/bin" >> $GITHUB_PATH - echo "$GITHUB_WORKSPACE" - echo "this is the github workspace" + # - name: Setup Cairo for Linux + # id: install-cairo + # shell: bash + # run: | + # wget https://github.com/starkware-libs/cairo/releases/download/${{ inputs.cairo_version }}/release-x86_64-unknown-linux-musl.tar.gz + # tar -xvzf release-x86_64-unknown-linux-musl.tar.gz + # mv -vf cairo cairo-build + # echo "$GITHUB_WORKSPACE/cairo-build/bin" >> $GITHUB_PATH + # echo "$GITHUB_WORKSPACE" + # echo "this is the github workspace" - name: Setup Scarb for Linux id: install-scarb shell: bash run: | - wget https://github.com/software-mansion/scarb/releases/download/${{ inputs.scarb_version }}/scarb-${{ inputs.scarb_version }}-x86_64-unknown-linux-gnu.tar.gz - tar -xvzf scarb-${{ inputs.scarb_version }}-x86_64-unknown-linux-gnu.tar.gz - mv -vf scarb-${{ inputs.scarb_version }}-x86_64-unknown-linux-gnu scarb-build + if [ "${{ inputs.use_musl_libc }}" = "true" ]; then + libc_version="musl" + else + libc_version="gnu" + fi + wget https://github.com/software-mansion/scarb/releases/download/${{ inputs.scarb_version }}/scarb-${{ inputs.scarb_version }}-x86_64-unknown-linux-${libc_version}.tar.gz + tar -xvzf scarb-${{ inputs.scarb_version }}-x86_64-unknown-linux-${libc_version}.tar.gz + mv -vf scarb-${{ inputs.scarb_version }}-x86_64-unknown-linux-${libc_version} scarb-build echo "$GITHUB_WORKSPACE/scarb-build/bin" >> $GITHUB_PATH