From 9cb0222d839902de00b2b8849dfc5ec3695467fd Mon Sep 17 00:00:00 2001 From: Howard Butler Date: Thu, 9 May 2024 15:04:29 -0500 Subject: [PATCH 1/5] refactor CI stuff so it is simpler and better contained --- .github/workflows/{linux.yml => build.yml} | 21 +++++++--- .github/workflows/macos.yml | 44 ------------------- .github/workflows/windows.yml | 49 ---------------------- environment.yml | 11 +++++ 4 files changed, 26 insertions(+), 99 deletions(-) rename .github/workflows/{linux.yml => build.yml} (67%) delete mode 100644 .github/workflows/macos.yml delete mode 100644 .github/workflows/windows.yml create mode 100644 environment.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/build.yml similarity index 67% rename from .github/workflows/linux.yml rename to .github/workflows/build.yml index c0d8a6d..bdc7dcc 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/build.yml @@ -1,17 +1,23 @@ -name: Linux build +name: Build on: [push, pull_request] jobs: - linux-build: - name: Linux build - runs-on: ubuntu-latest + build: + name: Compile on ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false + matrix: + os: [macos-latest, windows-latest, ubuntu-latest] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + + - name: Setup MSVC environment + uses: ilammy/msvc-dev-cmd@v1 + if: matrix.os == 'windows-latest' - name: Setup Conda uses: conda-incubator/setup-miniconda@v2 @@ -31,7 +37,10 @@ jobs: shell: bash -l {0} working-directory: ./build run: | - LDFLAGS="$LDFLAGS -Wl,-rpath-link,$CONDA_PREFIX/lib -pthread -lpthread" \ + if [ "$RUNNER_OS" == "Windows" ]; then + export CC=cl.exe + export CXX=cl.exe + fi cmake -G Ninja \ -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \ .. diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml deleted file mode 100644 index e46c822..0000000 --- a/.github/workflows/macos.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: MacOS build - -on: [push, pull_request] - -jobs: - macos-build: - name: MacOS build - runs-on: macos-latest - strategy: - fail-fast: false - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup Conda - uses: conda-incubator/setup-miniconda@v2 - with: - channels: conda-forge - auto-update-conda: true - - - name: Install dependencies - shell: bash -l {0} - run: | - mkdir build - conda update -n base -c defaults conda - conda install -c conda-forge cmake ninja -y - conda install -c conda-forge --yes --quiet pdal -y - - - name: Run cmake - shell: bash -l {0} - working-directory: ./build - run: | - cmake -G Ninja \ - -DCMAKE_FIND_FRAMEWORK="NEVER" \ - -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \ - .. - - - name: Build pdal_wrench - shell: bash -l {0} - working-directory: ./build - run: | - ninja - ninja install diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100644 index a3ec622..0000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Windows build - -on: [push, pull_request] - -jobs: - windows-build: - name: MSVC build - runs-on: windows-latest - strategy: - fail-fast: false - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup MSVC environment - uses: ilammy/msvc-dev-cmd@v1 - - - name: Setup Conda - uses: conda-incubator/setup-miniconda@v2 - with: - channels: conda-forge - auto-update-conda: true - - - name: Install dependencies - shell: bash -l {0} - run: | - mkdir build - conda update -n base -c defaults conda - conda install -c conda-forge cmake ninja -y - conda install -c conda-forge --yes --quiet pdal -y - - - name: Run cmake - shell: bash -l {0} - working-directory: ./build - run: | - export CC=cl.exe - export CXX=cl.exe - cmake -G "Ninja" \ - -DCMAKE_INSTALL_PREFIX="$CONDA_PREFIX" \ - -DCMAKE_PREFIX_PATH="$CONDA_PREFIX/Library" \ - .. - - - name: Build pdal_wrench - shell: bash -l {0} - working-directory: ./build - run: | - ninja -v - ninja install diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..fac9fb6 --- /dev/null +++ b/environment.yml @@ -0,0 +1,11 @@ +name: wrench +channels: + - conda-forge +dependencies: + - conda + - mamba + - compilers + - ninja + - cmake + - pdal + From 0f69af12a456b4f04ba46f625f05e8180f83520c Mon Sep 17 00:00:00 2001 From: Howard Butler Date: Thu, 9 May 2024 15:11:23 -0500 Subject: [PATCH 2/5] different conda setup --- .github/workflows/build.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bdc7dcc..8290419 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,11 +19,14 @@ jobs: uses: ilammy/msvc-dev-cmd@v1 if: matrix.os == 'windows-latest' - - name: Setup Conda - uses: conda-incubator/setup-miniconda@v2 + - uses: mamba-org/setup-micromamba@v1 + name: Setup Conda with: - channels: conda-forge - auto-update-conda: true + init-shell: bash + environment-file: environment.yml + environment-name: "wrench" + cache-environment: true + cache-downloads: true - name: Install dependencies shell: bash -l {0} From 1c6d6570291dd45d36af816b2c0fb9a48ed46d16 Mon Sep 17 00:00:00 2001 From: Howard Butler Date: Thu, 9 May 2024 15:11:40 -0500 Subject: [PATCH 3/5] cancelability --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8290419..b62c441 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,11 @@ name: Build on: [push, pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + jobs: build: name: Compile on ${{ matrix.os }} From 20c294ec9d25a0ac7d92b7a42d8e30c8b4901ebe Mon Sep 17 00:00:00 2001 From: Howard Butler Date: Fri, 10 May 2024 09:26:38 -0500 Subject: [PATCH 4/5] remove unnecessary stuff --- .github/workflows/build.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b62c441..d77f54e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,14 +33,6 @@ jobs: cache-environment: true cache-downloads: true - - name: Install dependencies - shell: bash -l {0} - run: | - mkdir build - conda update -n base -c defaults conda - conda install -c conda-forge cmake ninja compilers -y - conda install -c conda-forge --yes --quiet pdal -y - - name: Run cmake shell: bash -l {0} working-directory: ./build From 78630dab390e603e7a257bcce5c42275348be62a Mon Sep 17 00:00:00 2001 From: Howard Butler Date: Fri, 10 May 2024 09:30:34 -0500 Subject: [PATCH 5/5] oops --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d77f54e..895a5c9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,6 +33,11 @@ jobs: cache-environment: true cache-downloads: true + - name: Create working directory + shell: bash -l {0} + run: | + mkdir build + - name: Run cmake shell: bash -l {0} working-directory: ./build