From d69067efb128905f2ff228566a27c3efb43df126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20L=C3=A4ufer?= Date: Thu, 5 Dec 2024 15:08:10 -0500 Subject: [PATCH] ci: extract setup yices --- .github/workflows/setup-bitwuzla/action.yml | 3 +++ .github/workflows/setup-yices/action.yml | 28 +++++++++++++++++++++ .github/workflows/test.yml | 19 +++----------- 3 files changed, 34 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/setup-yices/action.yml diff --git a/.github/workflows/setup-bitwuzla/action.yml b/.github/workflows/setup-bitwuzla/action.yml index a445496..09b4eda 100644 --- a/.github/workflows/setup-bitwuzla/action.yml +++ b/.github/workflows/setup-bitwuzla/action.yml @@ -15,9 +15,11 @@ runs: key: bitwuzla-${{ runner.os }}-${{ inputs.version }} path: /tmp/bitwuzla - name: Install Meson for Bitwuzla + shell: sh run: sudo apt-get install -y meson - name: Download and Compile Bitwuzla if: ${{ steps.cache-bitwuzla.outputs.cache-hit != 'true' }} + shell: sh run: | mkdir /tmp/bitwuzla cd /tmp/bitwuzla @@ -28,4 +30,5 @@ runs: cd build ninja - name: Install Bitwuzla + shell: sh run: cd /tmp/bitwuzla/build && sudo ninja install \ No newline at end of file diff --git a/.github/workflows/setup-yices/action.yml b/.github/workflows/setup-yices/action.yml new file mode 100644 index 0000000..9d2ff2f --- /dev/null +++ b/.github/workflows/setup-yices/action.yml @@ -0,0 +1,28 @@ +name: Setup Yices + +inputs: + version: + description: version to install + required: true + +runs: + using: composite + steps: + - name: Cache Yices + id: cache-yices + uses: actions/cache@v3 + with: + key: yices-${{ runner.os }}-${{ inputs.version }} + path: /tmp/yices2 + - name: Download Yices2 + shell: sh + if: ${{ steps.cache-yices.outputs.cache-hit != 'true' }} + run: | + mkdir /tmp/yices2 + cd /tmp/yices2 + wget -q https://yices.csl.sri.com/releases/${{ inputs.version }}/yices-${{ inputs.version }}-x86_64-pc-linux-gnu-static-gmp.tar.gz -O yices.tar.gz + tar -xf yices.tar.gz + mv yices-*/* . + - name: Add Yices to Path + shell: sh + run: echo "/tmp/yices2/bin" >> "$GITHUB_PATH" \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ea480fe..4fd7396 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,24 +42,11 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Cache Yices - id: cache-yices - uses: actions/cache@v3 + - name: Set Up Yices if: ${{ matrix.solver == 'yices2' }} + uses: ./.github/workflows/setup-yices with: - key: yices-${{ runner.os }}-${{ env.YICES_VERSION }} - path: /tmp/yices2 - - name: Download Yices2 - if: ${{ matrix.solver == 'yices2' && steps.cache-yices.outputs.cache-hit != 'true' }} - run: | - mkdir /tmp/yices2 - cd /tmp/yices2 - wget -q https://yices.csl.sri.com/releases/${{ env.YICES_VERSION }}/yices-${{ env.YICES_VERSION }}-x86_64-pc-linux-gnu-static-gmp.tar.gz -O yices.tar.gz - tar -xf yices.tar.gz - mv yices-*/* . - - name: Add Yices to Path - if: ${{ matrix.solver == 'yices2' }} - run: echo "/tmp/yices2/bin" >> "$GITHUB_PATH" + version: ${{ env.YICES_VERSION }} - name: Set Up Bitwuzla if: ${{ matrix.solver == 'bitwuzla' }} uses: ./.github/workflows/setup-bitwuzla