Skip to content

Commit

Permalink
Use Conda for both linux and macos builds
Browse files Browse the repository at this point in the history
  • Loading branch information
pomadchin committed Jan 8, 2024
1 parent 7783ee9 commit c5ec84d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 58 deletions.
87 changes: 33 additions & 54 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,10 @@ on:
# types: [published]

jobs:
linux:
build:
strategy:
matrix:
os: [ubuntu-latest]
image: ['daunnc/pdal-ubuntu:2.6.0']
runs-on: ${{ matrix.os }}
container:
image: ${{ matrix.image }}

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
# https://github.com/actions/runner/issues/2033
- name: Set ownership
run: |
# this is to fix GIT not liking owner of the checkout dir
chown -R $(id -u):$(id -g) $PWD
- uses: coursier/cache-action@v6

- name: Check formatting
run: ./sbt scalafmtCheckAll

- name: Build project
run: ./sbt +test

macos:
strategy:
matrix:
os: [macos-latest]
os: [ubuntu-latest, macos-latest]
java: [8]
distribution: [temurin]
pdal: [2.6.2]
Expand All @@ -61,29 +34,23 @@ jobs:

- uses: conda-incubator/setup-miniconda@v3
with:
# auto-update-conda: true
# auto-activate-base: true
activate-environment: "pdal-java"
activate-environment: pdal-java
channels: conda-forge

- name: Install PDAL
run: conda install pdal=${{ matrix.pdal }}

# - name: Check formatting
# run: sbt scalafmtCheckAll
- name: Set LD_LIBRARY_PATH
run: echo "LD_LIBRARY_PATH=$CONDA/envs/pdal-java/lib:/usr/local/lib:$LD_LIBRARY_PATH" >> "$GITHUB_ENV"

- name: Check formatting
run: sbt scalafmtCheckAll

- name: Build project
run: |
# export PDAL_DIR=$CONDAenvs/pdal-java/
echo "CONA: $CONDA"
ls $CONDA
echo "========"
ls ${CONDA}/envs
echo "======="
which pdal
sbt +test
run: sbt +test

- uses: actions/upload-artifact@v3
if: ${{ startsWith(matrix.os, 'macos') }}
with:
name: macos
path: native/target/native/x86_64-darwin/bin
Expand All @@ -92,12 +59,15 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
image: ['daunnc/pdal-ubuntu:2.5.1']
java: [8]
distribution: [temurin]
pdal: [2.6.2]
runs-on: ${{ matrix.os }}
needs: [linux, macos]
container:
image: ${{ matrix.image }}
if: github.event_name != 'pull_request'
needs: [build]
defaults:
run:
shell: bash -el {0}
env:
PDAL_DEPEND_ON_NATIVE: "false"
CI_CLEAN: ""
Expand All @@ -106,21 +76,30 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
# https://github.com/actions/runner/issues/2033
- name: Set ownership
run: |
# this is to fix GIT not liking owner of the checkout dir
chown -R $(id -u):$(id -g) $PWD
- uses: coursier/cache-action@v6
- uses: actions/setup-java@v3
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}

- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: pdal-java
channels: conda-forge

- name: Install PDAL
run: conda install pdal=${{ matrix.pdal }}

- name: Set LD_LIBRARY_PATH
run: echo "LD_LIBRARY_PATH=$CONDA/envs/pdal-java/lib:/usr/local/lib:$LD_LIBRARY_PATH" >> "$GITHUB_ENV"

- uses: actions/download-artifact@v3
with:
name: macos
path: native/target/native/x86_64-darwin/bin

- name: Release
run: ./sbt ci-release
run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
Expand Down
4 changes: 0 additions & 4 deletions native/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ if (JNI_FOUND)
endif()

if (NOT PDAL_BUILD)
if(DEFINED ENV{PDAL_DIR})
set(PDAL_DIR "$ENV{PDAL_DIR}")
endif()

find_package(PDAL 2.0.0 REQUIRED CONFIG)
endif()

Expand Down

0 comments on commit c5ec84d

Please sign in to comment.