diff --git a/.github/workflows/ci_test_docker.yml b/.github/workflows/ci_test_docker.yml index 51991a10d..fc49c580f 100644 --- a/.github/workflows/ci_test_docker.yml +++ b/.github/workflows/ci_test_docker.yml @@ -4,6 +4,8 @@ on: [pull_request,workflow_dispatch] env: TEST_TAG: dtcenter/ccpp-scm:test + PR_NUMBER: ${{ github.event.number }} + jobs: docker: @@ -26,4 +28,7 @@ jobs: run: | mkdir $HOME/output chmod a+rw $HOME/output - docker run --rm -v $HOME/output:/home ${{ env.TEST_TAG }} ./run_scm.py -f ../../test/rt_test_cases.py --runtime_mult 0.1 -d -a + docker run \ + -e PR_NUMBER="${PR_NUMBER}" \ + --rm -v $HOME/output:/home ${{ env.TEST_TAG }} \ + ./run_scm.py -f ../../test/rt_test_cases.py --runtime_mult 0.1 -d -a diff --git a/docker/Dockerfile b/docker/Dockerfile index 85ad4d856..2d6d4cba7 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -70,11 +70,21 @@ ENV sp_ROOT=/comsoftware/nceplibs ENV w3emc_ROOT=/comsoftware/nceplibs # Obtain CCPP SCM source code, build code, and download static data -RUN cd /comsoftware \ - && git clone --recursive -b main https://github.com/NCAR/ccpp-scm \ - && mkdir /comsoftware/ccpp-scm/scm/bin - -RUN cd /comsoftware/ccpp-scm/scm/bin \ +RUN if [ -z "$PR_NUMBER" ]; then \ + cd /comsoftware \ + && git clone https://github.com/NCAR/ccpp-scm \ + && cd ccpp-scm \ + && git checkout origin pull/${PR_NUMBER}/head:test_pr \ + && git checkout test_pr \ + && git submodule update --init --recursive; \ + else \ + cd /comsoftware \ + && git clone --recursive -b main https://github.com/NCAR/ccpp-scm; \ + fi + + +RUN mkdir /comsoftware/ccpp-scm/scm/bin \ + && cd /comsoftware/ccpp-scm/scm/bin \ && cmake ../src \ && make -j