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 47247ee
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 57 deletions.
79 changes: 26 additions & 53 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,20 @@ jobs:

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

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

# - name: Check formatting
# run: sbt scalafmtCheckAll
- 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,11 +56,14 @@ 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 }}
defaults:
run:
shell: bash -el {0}
needs: [build]
if: github.event_name != 'pull_request'
env:
PDAL_DEPEND_ON_NATIVE: "false"
Expand All @@ -106,21 +73,27 @@ 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 }}

- 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 47247ee

Please sign in to comment.