|
| 1 | +name: Jobs shared by docs workflows that run when a dependency is updated |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + # Conda is always needed for both jobs in this workflow. Here, |
| 7 | + # we set default values for the variables in case the calling |
| 8 | + # workflow doesn't provide them. |
| 9 | + conda_env_file: |
| 10 | + required: false |
| 11 | + type: string |
| 12 | + default: "python/conda_env_ctsm_py.yml" |
| 13 | + conda_env_name: |
| 14 | + required: false |
| 15 | + type: string |
| 16 | + default: "ctsm_pylib" |
| 17 | + secrets: {} |
| 18 | + |
| 19 | +jobs: |
| 20 | + compare-docbuilder-vs-ctsmpylib: |
| 21 | + name: Are both methods identical? |
| 22 | + |
| 23 | + # Don't run on forks, because test_container_eq_ctsm_pylib.sh uses |
| 24 | + # build_docs_to_publish, which will look for branch(es) that forks |
| 25 | + # may not have |
| 26 | + if: ${{ github.repository == 'ESCOMP/CTSM' }} |
| 27 | + |
| 28 | + runs-on: ubuntu-latest |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@v4 |
| 31 | + with: |
| 32 | + fetch-depth: 0 |
| 33 | + lfs: true |
| 34 | + |
| 35 | + # Check out all submodules because we might :literalinclude: something from one |
| 36 | + - name: Checkout all submodules |
| 37 | + run: | |
| 38 | + bin/git-fleximod update -o |
| 39 | +
|
| 40 | + - name: Set up conda environment |
| 41 | + uses: conda-incubator/setup-miniconda@v3 |
| 42 | + with: |
| 43 | + activate-environment: ${{ inputs.conda_env_name }} |
| 44 | + environment-file: ${{ inputs.conda_env_file }} |
| 45 | + channels: conda-forge |
| 46 | + auto-activate-base: false |
| 47 | + |
| 48 | + - name: Compare docs built with container vs. ctsm_pylib |
| 49 | + run: | |
| 50 | + cd doc/test/ |
| 51 | + ./test_container_eq_ctsm_pylib.sh |
| 52 | +
|
| 53 | + makefile-method: |
| 54 | + runs-on: ubuntu-latest |
| 55 | + steps: |
| 56 | + - uses: actions/checkout@v4 |
| 57 | + with: |
| 58 | + fetch-depth: 0 |
| 59 | + lfs: true |
| 60 | + |
| 61 | + # Check out all submodules because we might :literalinclude: something from one |
| 62 | + - name: Checkout all submodules |
| 63 | + run: | |
| 64 | + bin/git-fleximod update -o |
| 65 | +
|
| 66 | + - name: Set up conda environment |
| 67 | + uses: conda-incubator/setup-miniconda@v3 |
| 68 | + with: |
| 69 | + activate-environment: ${{ inputs.conda_env_name }} |
| 70 | + environment-file: ${{ inputs.conda_env_file }} |
| 71 | + channels: conda-forge |
| 72 | + auto-activate-base: false |
| 73 | + |
| 74 | + - name: Check that Makefile method works |
| 75 | + run: | |
| 76 | + cd doc/test/ |
| 77 | + conda run -n ${{ inputs.conda_env_name }} --no-capture-output ./test_makefile_method.sh |
0 commit comments