More GitHub tests #4
This file contains hidden or 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
| name: Test doc-builder | |
| on: | |
| push: | |
| pull_request: | |
| schedule: | |
| # 8 am every Monday UTC | |
| - cron: '0 8 * * 1' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| test-pythons: | |
| name: Test in Python ${{ matrix.python-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| # If testing with in "act" on Macs, make sure to add '--container-architecture linux/amd64'. | |
| # Even then, old Python versions might not be available. | |
| python-version: [3.6, 3.x] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| lfs: true | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Unit/system tests | |
| if: success() || failure() | |
| run: | | |
| make -C test | |
| exit 1 | |
| # -C test is needed because, if you just cd test/ beforehand, git commands in tests fail with an error | |
| lint-and-test-conda: | |
| name: Lint and test in Conda env | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| lfs: true | |
| - name: Set up conda environment | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| activate-environment: doc-builder-python3.6 | |
| environment-file: test/python3.6_test_conda.yml | |
| channels: conda-forge | |
| auto-activate-base: false | |
| - name: Pylint | |
| run: | | |
| cd test | |
| conda run -n doc-builder-python3.6 make lint | |
| - name: Unit/system tests | |
| if: success() || failure() | |
| run: | | |
| conda run -n doc-builder-python3.6 make -C test | |
| # -C test is needed because, if you just cd test/ beforehand, git commands in tests fail with an error | |
| # File an issue if either of the above jobs failed during a scheduled or manual run | |
| file-issue-on-failure: | |
| if: | | |
| (needs.test-pythons.result == 'failure' || needs.lint-and-test-conda.result == 'failure') && | |
| (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') | |
| needs: [test-pythons, lint-and-test-conda] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Create issue | |
| uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| filename: .github/workflows/docs-ctsm_pylib.issue_template.md | |
| update_existing: true | |
| search_existing: open | |