diff --git a/.github/workflows/test.yml b/.github/workflows/build.yml similarity index 65% rename from .github/workflows/test.yml rename to .github/workflows/build.yml index 659f4618..fd5690fa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/build.yml @@ -11,9 +11,16 @@ jobs: fail-fast: false matrix: - config: [Release, Debug] + config: + - Release + - Debug + + os: + - macos-latest + - ubuntu-latest + - windows-latest + vtk-system: [true, false] - os: [ubuntu-latest, windows-latest, macos-latest] exclude: - os: macos-latest @@ -25,7 +32,7 @@ jobs: runs-on: ${{ matrix.os }} container: ${{ matrix.os == 'ubuntu-latest' && 'fedora:38' || null }} - name: '๐Ÿงช Test on ${{ matrix.os }} [Config: "${{ matrix.config }}", VTK installed: "${{ matrix.vtk-system }}"]' + name: '๐Ÿงช Test on ${{ matrix.os }} ["${{ matrix.config }}", VTK: "${{ matrix.vtk-system }}"]' steps: - name: ๐Ÿ“ฅ Checkout @@ -40,13 +47,11 @@ jobs: - name: ๐Ÿฆฅ Cache Dependencies uses: actions/cache@v3 with: - key: ${{ matrix.os }}-${{ matrix.config }}-cache - path: | - deps-cache - build + key: test-${{ matrix.os }}-${{ matrix.config }}-${{ matrix.vtk-system }} + path: build - name: ๐Ÿ—๏ธ Compile - run: cmake -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCPM_SOURCE_CACHE=deps-cache -DVIENNALS_BUILD_TESTS=ON -B build && cmake --build build + run: cmake -DVIENNALS_BUILD_TESTS=ON -B build && cmake --build build --config ${{ matrix.config }} - name: ๐Ÿงช Test run: ctest -E "Benchmark|Performance" -C ${{ matrix.config }} --test-dir build diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 4414eb34..3467e948 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -11,20 +11,12 @@ jobs: fail-fast: false matrix: - vtk-system: [true, false] os: [ubuntu-latest, windows-latest, macos-latest] - exclude: - - os: macos-latest - vtk-system: true - - - os: windows-latest - vtk-system: true - runs-on: ${{ matrix.os }} container: ${{ matrix.os == 'ubuntu-latest' && 'fedora:38' || null }} - name: '๐Ÿ Build Bindings on ${{ matrix.os }} [VTK installed: "${{ matrix.vtk-system }}"]' + name: "๐Ÿ Build Bindings on ${{ matrix.os }}" steps: - name: ๐Ÿ“ฅ Checkout @@ -34,7 +26,31 @@ jobs: uses: ./.github/actions/setup with: container: ${{ matrix.os }} - install-vtk: ${{ matrix.vtk-system }} + install-vtk: false - - name: ๐Ÿ Build Python Module - run: pip3 install --user . -v + - name: ๐Ÿฆฅ Cache Dependencies + uses: actions/cache@v3 + with: + key: python-${{ matrix.os }} + path: build + + - name: ๐Ÿ Build and check Python Module (Windows) + if: ${{ matrix.os == 'windows-latest' }} + run: | + python3 -m venv venv + ./venv/Scripts/activate.bat + pip install . + python3 -c "import viennals2d; print(viennals2d.__doc__)" + + - name: ๐Ÿ Build and check Python Module (Other) + if: ${{ matrix.os != 'windows-latest' }} + run: | + python3 -m venv venv + ./venv/bin/pip install . + ./venv/bin/python -c "import viennals2d; print(viennals2d.__doc__)" + + - name: ๐Ÿ“ฆ Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: Pre-Built (${{ matrix.os }}) + path: venv