From e2e00098e7d393fa474a2ab2c9b6f954df85d581 Mon Sep 17 00:00:00 2001 From: bpuchala Date: Wed, 16 Aug 2023 14:48:06 -0400 Subject: [PATCH] remove cross platform testing --- .github/workflows/test-linux-build.yml | 30 +++++--- .github/workflows/test-linux-cxx-only.yml | 24 +++++- .github/workflows/test-linux-dependencies.yml | 53 +++++++++++++ .github/workflows/test-linux-source.yml | 75 ------------------- .github/workflows/test-linux.yml | 21 +++++- 5 files changed, 112 insertions(+), 91 deletions(-) create mode 100644 .github/workflows/test-linux-dependencies.yml delete mode 100644 .github/workflows/test-linux-source.yml diff --git a/.github/workflows/test-linux-build.yml b/.github/workflows/test-linux-build.yml index 1891119..f461ec7 100644 --- a/.github/workflows/test-linux-build.yml +++ b/.github/workflows/test-linux-build.yml @@ -3,11 +3,14 @@ name: Testing build on ubuntu-latest on: [push, pull_request] env: - SKBUILD_CONFIGURE_OPTIONS: -DCMAKE_CXX_FLAGS='-D_GLIBCXX_USE_CXX11_ABI=0' SKBUILD_BUILD_OPTIONS: --verbose jobs: + build-depends: + uses: ./.github/workflows/test-linux-dependencies.yml + build: + needs: build-depends runs-on: ubuntu-latest timeout-minutes: 60 steps: @@ -21,16 +24,28 @@ jobs: sudo apt-get update sudo apt-get install build-essential cmake pip install --upgrade pip wheel build - pip install -r test_requirements.txt - echo "SKBUILD_CONFIGURE_OPTIONS=${{ env.SKBUILD_CONFIGURE_OPTIONS }}" >> "$GITHUB_ENV" echo "SKBUILD_BUILD_OPTIONS=${{ env.SKBUILD_BUILD_OPTIONS }}" >> "$GITHUB_ENV" + ### libcasm-global ### + - name: restore libcasm-global cache + id: cache-libcasm-global-restore + uses: actions/cache/restore@v3 + with: + path: CASMcode_global/dist + key: ${{ runner.os }}-libcasm-global-v2-0-3 + + - name: Install CASM dependencies + run: | + pip install CASMcode_global/dist/*.whl + pip install -r build_requirements.txt + pip install -r test_requirements.txt + - name: make shell: bash run: | python -m build - - name: install + - name: make install shell: bash run: | pip install dist/*.whl @@ -39,10 +54,3 @@ jobs: shell: bash run: | python -m pytest -rsap python/tests - - - name: upload libcasm-xtal-ubuntu-latest-x86_64-dist - if: always() - uses: actions/upload-artifact@v3 - with: - name: libcasm-xtal-ubuntu-latest-x86_64-dist - path: dist diff --git a/.github/workflows/test-linux-cxx-only.yml b/.github/workflows/test-linux-cxx-only.yml index 0ac6d70..8666378 100644 --- a/.github/workflows/test-linux-cxx-only.yml +++ b/.github/workflows/test-linux-cxx-only.yml @@ -2,7 +2,13 @@ name: Testing c++ only on ubuntu-latest on: [push, pull_request] +env: + SKBUILD_BUILD_OPTIONS: --verbose + jobs: + build-depends: + uses: ./.github/workflows/test-linux-dependencies.yml + build: runs-on: ubuntu-latest timeout-minutes: 60 @@ -16,6 +22,20 @@ jobs: run: | sudo apt-get update sudo apt-get install build-essential cmake + pip install --upgrade pip wheel build + echo "SKBUILD_BUILD_OPTIONS=${{ env.SKBUILD_BUILD_OPTIONS }}" >> "$GITHUB_ENV" + + ### libcasm-global ### + - name: restore libcasm-global cache + id: cache-libcasm-global-restore + uses: actions/cache/restore@v3 + with: + path: CASMcode_global/dist + key: ${{ runner.os }}-libcasm-global-v2-0-3 + + - name: Install CASM dependencies + run: | + pip install CASMcode_global/dist/*.whl pip install -r build_requirements.txt - name: configure @@ -23,7 +43,7 @@ jobs: run: | mkdir build_cxx_only cd build_cxx_only - cmake -DCMAKE_CXX_FLAGS='-D_GLIBCXX_USE_CXX11_ABI=0' -DCMAKE_BUILD_TYPE=Release .. + cmake -DCMAKE_BUILD_TYPE=Release .. - name: make shell: bash @@ -42,7 +62,7 @@ jobs: run: | mkdir build_cxx_test cd build_cxx_test - cmake -DCMAKE_CXX_FLAGS='-D_GLIBCXX_USE_CXX11_ABI=0' -DCMAKE_BUILD_TYPE=Release ../tests + cmake -DCMAKE_BUILD_TYPE=Release ../tests - name: make tests shell: bash diff --git a/.github/workflows/test-linux-dependencies.yml b/.github/workflows/test-linux-dependencies.yml new file mode 100644 index 0000000..969bcdd --- /dev/null +++ b/.github/workflows/test-linux-dependencies.yml @@ -0,0 +1,53 @@ +name: Build CASM dependencies on Ubuntu + +on: + workflow_call: + +jobs: + build-depends: + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Set up requirements & configuration variables + run: | + sudo apt-get update + sudo apt-get install build-essential cmake + pip install --upgrade pip wheel build + + ### libcasm-global ### + - name: restore libcasm-global cache + id: cache-libcasm-global-restore + uses: actions/cache/restore@v3 + with: + path: CASMcode_global/dist + key: ${{ runner.os }}-libcasm-global-v2-0-3 + + - name: checkout libcasm-global + if: steps.cache-libcasm-global-restore.outputs.cache-hit != 'true' + uses: actions/checkout@v3 + with: + repository: prisms-center/CASMcode_global + path: CASMcode_global + ref: v2.0.3 + + - name: make global + if: steps.cache-libcasm-global-restore.outputs.cache-hit != 'true' + shell: bash + run: | + cd CASMcode_global + git submodule update --init --recursive + python -m build + pip install dist/*.whl + pip install -r test_requirements.txt + python -m pytest -rsap python/tests + + - name: save libcasm-global cache + id: cache-libcasm-global-save + uses: actions/cache/save@v3 + with: + path: CASMcode_global/dist + key: ${{ steps.cache-libcasm-global-restore.outputs.cache-primary-key }} diff --git a/.github/workflows/test-linux-source.yml b/.github/workflows/test-linux-source.yml deleted file mode 100644 index 1407f85..0000000 --- a/.github/workflows/test-linux-source.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: Testing source build on ubuntu-latest - -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - - name: checkout libcasm-global - uses: actions/checkout@v3 - with: - repository: prisms-center/CASMcode_global - path: CASMcode_global - - - name: checkout libcasm-xtal - uses: actions/checkout@v3 - with: - path: CASMcode_crystallography - - - name: Set up requirements & configuration variables - run: | - sudo apt-get update - sudo apt-get install build-essential cmake - pip install --upgrade pip wheel - - - name: make global - shell: bash - run: | - cd CASMcode_global - git submodule update --init --recursive - pip install -v . - - - name: make test global - shell: bash - run: | - cd CASMcode_global - pip install -r test_requirements.txt - python -m pytest -rsap python/tests - - - name: make - shell: bash - run: | - cd CASMcode_crystallography - pip install -v . - - - name: make test - shell: bash - run: | - cd CASMcode_crystallography - pip install -r test_requirements.txt - python -m pytest -rsap python/tests - - - name: Set up doc requirements - run: | - cd CASMcode_crystallography - pip install -r doc_requirements.txt - - - name: build docs - shell: bash - run: | - cd CASMcode_crystallography - cd python/doc - sphinx-build -b html . _build/html - - - name: upload docs - if: always() - uses: actions/upload-artifact@v3 - with: - name: libcasm-xtal-docs - path: python/doc/_build/html diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 786f34a..6bba072 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -3,11 +3,14 @@ name: Testing on ubuntu-latest on: [push, pull_request] env: - SKBUILD_CONFIGURE_OPTIONS: -DCMAKE_CXX_FLAGS='-D_GLIBCXX_USE_CXX11_ABI=0' SKBUILD_BUILD_OPTIONS: --verbose jobs: + build-depends: + uses: ./.github/workflows/test-linux-dependencies.yml + build: + needs: build-depends runs-on: ubuntu-latest timeout-minutes: 60 steps: @@ -21,10 +24,21 @@ jobs: sudo apt-get update sudo apt-get install build-essential cmake pip install --upgrade pip wheel - pip install -r test_requirements.txt - echo "SKBUILD_CONFIGURE_OPTIONS=${{ env.SKBUILD_CONFIGURE_OPTIONS }}" >> "$GITHUB_ENV" echo "SKBUILD_BUILD_OPTIONS=${{ env.SKBUILD_BUILD_OPTIONS }}" >> "$GITHUB_ENV" + ### libcasm-global ### + - name: restore libcasm-global cache + id: cache-libcasm-global-restore + uses: actions/cache/restore@v3 + with: + path: CASMcode_global/dist + key: ${{ runner.os }}-libcasm-global-v2-0-3 + + - name: Install CASM dependencies + run: | + pip install CASMcode_global/dist/*.whl + pip install -r build_requirements.txt + - name: make shell: bash run: | @@ -33,6 +47,7 @@ jobs: - name: make test shell: bash run: | + pip install -r test_requirements.txt python -m pytest -rsap python/tests - name: Set up doc requirements