diff --git a/.github/actions/test_action/action.yml b/.github/actions/test_action/action.yml index 765e59eb..aced94d5 100644 --- a/.github/actions/test_action/action.yml +++ b/.github/actions/test_action/action.yml @@ -40,9 +40,31 @@ runs: -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DBIT7Z_BUILD_TESTS=ON -DBIT7Z_ENABLE_SANITIZERS=ON - -DBIT7Z_7ZIP_VERSION=${{ inputs.sevenzip_version }} + -DBIT7Z_7ZIP_VERSION="${{ inputs.sevenzip_version }}" ${{ inputs.build_flags }} -S ${{ github.workspace }} + + - name: Build 7z.so for tests (Ubuntu) + shell: bash + if: runner.os == 'Linux' + run: | + git clone --depth 1 https://github.com/rikyoz/7-Zip ${{ github.workspace }}/../7-zip + git -C ${{ github.workspace }}/../7-zip fetch --tags + git -C ${{ github.workspace }}/../7-zip checkout v${{ inputs.sevenzip_version }} + cd ${{ github.workspace }}/../7-zip/CPP/7zip/Bundles/Format7zF/ + make -j -f ../../cmpl_gcc.mak + cp b/g/7z.so ${{ github.workspace }}/bin/x64/7z.so + + - name: Build 7z.so for tests (macOS) + shell: bash + if: runner.os == 'macOS' + run: | + git clone --depth 1 https://github.com/rikyoz/7-Zip ${{ github.workspace }}/../7-zip + git -C ${{ github.workspace }}/../7-zip fetch --tags + git -C ${{ github.workspace }}/../7-zip checkout v${{ inputs.sevenzip_version }} + cd ${{ github.workspace }}/../7-zip/CPP/7zip/Bundles/Format7zF/ + make -j -f ../../cmpl_mac_x64.mak + cp b/m_x64/7z.so ${{ github.workspace }}/bin/x64/7z.so - name: Build bit7z shell: ${{ inputs.shell }} diff --git a/.github/workflows/test_macos.yml b/.github/workflows/test_macos.yml index 38351828..5871c11b 100644 --- a/.github/workflows/test_macos.yml +++ b/.github/workflows/test_macos.yml @@ -22,17 +22,6 @@ jobs: steps: - uses: actions/checkout@v3 - - - name: Build 7z.so for tests - shell: bash - run: | - mkdir -p ${{ github.workspace }}/bin/x64/ - git clone --depth 1 https://github.com/rikyoz/7-Zip ${{ github.workspace }}/../7-zip - git -C ${{ github.workspace }}/../7-zip fetch --tags - git -C ${{ github.workspace }}/../7-zip checkout v${{ matrix.bit7z_7zip_version }} - cd ${{ github.workspace }}/../7-zip/CPP/7zip/Bundles/Format7zF/ - make -j -f ../../cmpl_mac_x64.mak - cp b/m_x64/7z.so ${{ github.workspace }}/bin/x64/7z.so - name: Building and testing bit7z uses: ./.github/actions/test_action diff --git a/.github/workflows/test_ubuntu.yml b/.github/workflows/test_ubuntu.yml index c3537e02..1d83af92 100644 --- a/.github/workflows/test_ubuntu.yml +++ b/.github/workflows/test_ubuntu.yml @@ -31,22 +31,11 @@ jobs: - c_compiler: gcc bit7z_link_libcpp: ON - steps: - - name: Build 7z.so for tests - shell: bash - run: | - mkdir -p ${{ github.workspace }}/bin/x64/ - git clone --depth 1 https://github.com/rikyoz/7-Zip ${{ github.workspace }}/../7-zip - git -C ${{ github.workspace }}/../7-zip fetch --tags - git -C ${{ github.workspace }}/../7-zip checkout v${{ matrix.bit7z_7zip_version }} - cd ${{ github.workspace }}/../7-zip/CPP/7zip/Bundles/Format7zF/ - make -j -f ../../cmpl_gcc.mak - cp b/g/7z.so ${{ github.workspace }}/bin/x64/7z.so - + steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/test_action - name: Building and testing bit7z + - name: Building and testing bit7z + uses: ./.github/actions/test_action with: c_compiler: ${{ matrix.c_compiler }} cpp_compiler: ${{ matrix.cpp_compiler }}