-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make ./macro a python module + cleanup
- Loading branch information
1 parent
0c7c772
commit a1a8cff
Showing
16 changed files
with
544 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: cicd_docker | ||
|
||
on: | ||
# Run tests for non-draft pull request on main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
env: | ||
DOCKER_IMAGE_NAME: pdal_ign_plugin | ||
|
||
jobs: | ||
|
||
build_docker_image_and_run_tests: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout branch | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build docker image | ||
run: docker build -t ${{ env.DOCKER_IMAGE_NAME }}:test . | ||
|
||
- name: Run tests in docker image | ||
run: docker run ${{ env.DOCKER_IMAGE_NAME }}:test python -m pytest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
xcode | ||
.vscode | ||
build | ||
install | ||
__pycache__ | ||
*/__pycache__ | ||
test/__pycache_ | ||
test/.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,34 @@ | ||
FROM mambaorg/micromamba:bullseye-slim as build | ||
|
||
|
||
COPY environment_docker.yml /environment_docker.yml | ||
USER root | ||
RUN micromamba env create -f /environment_docker.yml | ||
|
||
USER root | ||
RUN micromamba env create -f /environment_docker.yml | ||
SHELL ["micromamba", "run", "-n", "pdal_ign_plugin", "/bin/bash", "-c"] | ||
RUN apt-get update && apt-get install --no-install-recommends -y cmake make build-essential g++ && rm -rf /var/lib/apt/lists/* | ||
COPY src src | ||
|
||
COPY src src | ||
COPY CMakeLists.txt CMakeLists.txt | ||
COPY macro macro | ||
|
||
RUN cmake -G"Unix Makefiles" -DCONDA_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=Release | ||
|
||
RUN cmake -G"Unix Makefiles" -DCONDA_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=Release | ||
RUN make -j4 install | ||
|
||
FROM debian:bullseye-slim | ||
|
||
COPY --from=build /opt/conda/envs/pdal_ign_plugin /opt/conda/envs/pdal_ign_plugin | ||
RUN mkdir -p /pdal_ign_plugin | ||
RUN mkdir -p /pdal_ign_plugin | ||
COPY --from=build /tmp/install/lib /pdal_ign_plugin/install/lib | ||
COPY --from=build /tmp/macro /macro | ||
|
||
ENV PATH=$PATH:/opt/conda/envs/pdal_ign_plugin/bin/ | ||
ENV PROJ_LIB=/opt/conda/envs/pdal_ign_plugin/share/proj/ | ||
ENV PATH=$PATH:/opt/conda/envs/pdal_ign_plugin/bin/ | ||
ENV PROJ_LIB=/opt/conda/envs/pdal_ign_plugin/share/proj/ | ||
ENV PDAL_DRIVER_PATH=/pdal_ign_plugin/install/lib | ||
|
||
# Install python macro module | ||
COPY macro /pdal_ign_plugin/macro | ||
COPY pyproject.toml /pdal_ign_plugin/pyproject.toml | ||
WORKDIR /pdal_ign_plugin | ||
RUN pip install . | ||
|
||
# Add example scripts + test data (to be able to test inside the docker image) | ||
COPY scripts /pdal_ign_plugin/scripts | ||
COPY test /pdal_ign_plugin/test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.