diff --git a/.github/workflows/cmake-linux.yml b/.github/workflows/cmake-linux.yml index df01bd2..6d841e8 100644 --- a/.github/workflows/cmake-linux.yml +++ b/.github/workflows/cmake-linux.yml @@ -8,8 +8,71 @@ on: branches: [ "*" ] jobs: + prepare-asset: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + lfs: false + + - name: Cache test fixtures + id: cache-test-fixtures + uses: actions/cache@v4 + with: + path: test/fixture + key: test-fixtures-v1 + + - name: Download assets(models) + if: steps.cache-test-fixtures.outputs.cache-hit != 'true' + shell: bash + run: | + ./test/fixture/download-test-fixtures.sh + + prepare-apt: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + name: [ Ubuntu-20, Ubuntu-22, Debian-11, Debian-12 ] + build_type: [ Debug ] + include: + - name: Ubuntu-20 + image: "ubuntu:20.04" + - name: Ubuntu-22 + image: "ubuntu:22.04" + - name: Debian-11 + image: "debian:11" + - name: Debian-12 + image: "debian:12" + + steps: + - uses: actions/checkout@v4 + with: + lfs: false + + - name: Cache dependencies(apt) + id: cache-dependencies-apt + uses: actions/cache@v4 + with: + path: .github/cache/dependencies-apt + key: ${{ matrix.image }}-dependencies-apt-v1 + + - name: Prepare container(apt download) + shell: bash + if: steps.cache-dependencies-apt.outputs.cache-hit != 'true' && (startsWith(matrix.image, 'debian:') || startsWith(matrix.image, 'ubuntu:')) + run: | + sudo apt-get update -qq + sudo apt-get install -yq --download-only build-essential clang-11 cmake libboost-all-dev libssl-dev libgtest-dev + cp /var/cache/apt/archives/*.deb .github/cache/dependencies-apt/ + + + + build: runs-on: ubuntu-latest + needs: [ "prepare-asset", "prepare-apt" ] strategy: fail-fast: false @@ -63,19 +126,6 @@ jobs: run: | ./onnxruntime-server/.github/actions/download-onnxruntime-linux.sh - - name: Cache test fixtures - id: cache-test-fixtures - uses: actions/cache@v4 - with: - path: onnxruntime-server/test/fixture - key: test-fixtures-v1 - - - name: Download assets(models) - if: steps.cache-test-fixtures.outputs.cache-hit != 'true' - shell: bash - run: | - ./onnxruntime-server/test/fixture/download-test-fixtures.sh - - name: Set reusable strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. id: strings @@ -99,6 +149,19 @@ jobs: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} --parallel 4 sudo cmake --install ${{ steps.strings.outputs.build-output-dir }}/pg_onnx + - name: Cache test fixtures + id: cache-test-fixtures + uses: actions/cache@v4 + with: + path: onnxruntime-server/test/fixture + key: test-fixtures-v1 + + - name: Download assets(models) + if: steps.cache-test-fixtures.outputs.cache-hit != 'true' + shell: bash + run: | + ./onnxruntime-server/test/fixture/download-test-fixtures.sh + - name: Test working-directory: ${{ steps.strings.outputs.build-output-dir }} # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). diff --git a/.github/workflows/cmake-macos.yml b/.github/workflows/cmake-macos.yml index ce6f29b..fda429c 100644 --- a/.github/workflows/cmake-macos.yml +++ b/.github/workflows/cmake-macos.yml @@ -34,19 +34,6 @@ jobs: brew update HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install cmake onnxruntime boost postgresql googletest - - name: Cache test fixtures - id: cache-test-fixtures - uses: actions/cache@v4 - with: - path: onnxruntime-server/test/fixture - key: test-fixtures-v1 - - - name: Download assets(models) - if: steps.cache-test-fixtures.outputs.cache-hit != 'true' - shell: bash - run: | - ./onnxruntime-server/test/fixture/download-test-fixtures.sh - - name: Set reusable strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. id: strings @@ -70,6 +57,19 @@ jobs: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} --parallel 4 sudo cmake --install ${{ steps.strings.outputs.build-output-dir }}/pg_onnx + - name: Cache test fixtures + id: cache-test-fixtures + uses: actions/cache@v4 + with: + path: onnxruntime-server/test/fixture + key: test-fixtures-v1 + + - name: Download assets(models) + if: steps.cache-test-fixtures.outputs.cache-hit != 'true' + shell: bash + run: | + ./onnxruntime-server/test/fixture/download-test-fixtures.sh + - name: Test working-directory: ${{ steps.strings.outputs.build-output-dir }} # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).