forked from NCAR/ccpp-physics
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (47 loc) · 2.03 KB
/
ci_scm_ccpp_prebuild.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: CI test to run SCM ccpp_prebuild step
on: [push, pull_request]
jobs:
ccpp-prebuild-SCM:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
steps:
- name: Checkout current ccpp-physics code
uses: actions/checkout@v3
- name: Store remote-URL for current ccpp-physics code
run: echo "GIT_REMOTE_URL=`git remote get-url origin`" >> $GITHUB_ENV
- name: Store branch name for current ccpp-physics code
run: echo "GIT_REMOTE_BRANCH=`git rev-parse --abbrev-ref HEAD`" >> $GITHUB_ENV
- name: Store hash for HEAD of current ccpp-physics code
run: echo "GIT_REMOTE_HASH=`git rev-parse HEAD`" >> $GITHUB_ENV
- name: Checkout latest ccpp-scm code
run: git clone https://github.com/NCAR/ccpp-scm.git
- name: Initialize submodules
run: |
cd /home/runner/work/ccpp-physics/ccpp-physics/ccpp-scm
git submodule update --init --recursive
- name: Update ccpp-physics hash in ccpp-scm
if: github.event.pull_request == false
run: |
cd /home/runner/work/ccpp-physics/ccpp-physics/ccpp-scm/ccpp/physics
echo $GIT_REMOTE_URL
echo $GIT_REMOTE_BRANCH
echo ${{github.repository}}
echo ${{ github.event.pull_request.head.sha }}
echo $GITHUB_SHA
git remote add remote_local $GIT_REMOTE_URL
git fetch remote_local $GIT_REMOTE_BRANCH
git checkout remote_local/$GIT_REMOTE_BRANCH
- name: Set up Python 3.8.5
uses: actions/setup-python@v3
with:
python-version: 3.8.5
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Run ccpp_prebuild.py
run: |
cd /home/runner/work/ccpp-physics/ccpp-physics/ccpp-scm/
git status
mkdir -p /home/runner/work/ccpp-physics/ccpp-physics/ccpp-scm/scm/bin/ccpp/physics/physics/
./ccpp/framework/scripts/ccpp_prebuild.py --config ccpp/config/ccpp_prebuild_config.py