From 888ed551f84084ff1bf8cb1baabd7c68d6d36d5b Mon Sep 17 00:00:00 2001 From: Bill Little Date: Mon, 20 Jun 2022 12:02:26 +0100 Subject: [PATCH 1/5] rationalise doctests gha --- .github/workflows/ci-docs-linkcheck.yml | 94 ------------------------- .github/workflows/ci-docs-tests.yml | 8 ++- README.md | 3 - noxfile.py | 17 ++++- 4 files changed, 21 insertions(+), 101 deletions(-) delete mode 100644 .github/workflows/ci-docs-linkcheck.yml diff --git a/.github/workflows/ci-docs-linkcheck.yml b/.github/workflows/ci-docs-linkcheck.yml deleted file mode 100644 index 2fc5722d7f..0000000000 --- a/.github/workflows/ci-docs-linkcheck.yml +++ /dev/null @@ -1,94 +0,0 @@ -# reference: -# - https://github.com/actions/cache -# - https://github.com/actions/checkout -# - https://github.com/marketplace/actions/setup-miniconda - -name: ci-docs-linkcheck - -on: - push: - branches: - - "main" - - "v*x" - tags: - - "v*" - pull_request: - branches: - - "*" - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - tests: - name: "linkcheck ${{ matrix.os }} ${{ matrix.python-version }}" - - runs-on: ${{ matrix.os }} - - defaults: - run: - shell: bash -l {0} - - strategy: - matrix: - os: ["ubuntu-latest"] - python-version: ["3.8"] - - env: - ENV_NAME: "ci-docs-linkcheck" - - steps: - - name: "checkout" - uses: actions/checkout@v3 - - - name: "environment configure" - env: - # Maximum cache period (in weeks) before forcing a cache refresh. - CACHE_WEEKS: 2 - run: | - echo "CACHE_PERIOD=$(date +%Y).$(expr $(date +%U) / ${CACHE_WEEKS})" >> ${GITHUB_ENV} - echo "LOCK_FILE=requirements/ci/nox.lock/py$(echo ${{ matrix.python-version }} | tr -d '.')-linux-64.lock" >> ${GITHUB_ENV} - - - name: "conda package cache" - uses: ./.github/workflows/composite/conda-pkg-cache - with: - cache_build: 1 - cache_period: ${{ env.CACHE_PERIOD }} - env_name: ${{ env.ENV_NAME }} - - - name: "conda install" - uses: conda-incubator/setup-miniconda@v2 - with: - miniforge-version: latest - channels: conda-forge,defaults - activate-environment: ${{ env.ENV_NAME }} - auto-update-conda: false - use-only-tar-bz2: true - - - name: "conda environment cache" - uses: ./.github/workflows/composite/conda-env-cache - with: - cache_build: 1 - cache_period: ${{ env.CACHE_PERIOD }} - env_name: ${{ env.ENV_NAME }} - install_packages: "nox pip" - - - name: "conda info" - run: | - conda info - conda list - - - name: "nox cache" - uses: ./.github/workflows/composite/nox-cache - with: - cache_build: 1 - env_name: ${{ env.ENV_NAME }} - lock_file: ${{ env.LOCK_FILE }} - - - name: "iris linkcheck" - env: - PY_VER: ${{ matrix.python-version }} - run: | - nox --session linkcheck -- --verbose diff --git a/.github/workflows/ci-docs-tests.yml b/.github/workflows/ci-docs-tests.yml index 91366f4a06..a41c797191 100644 --- a/.github/workflows/ci-docs-tests.yml +++ b/.github/workflows/ci-docs-tests.yml @@ -23,7 +23,7 @@ concurrency: jobs: tests: - name: "doctests ${{ matrix.os }} ${{ matrix.python-version }}" + name: "${{ matrix.session }} ${{ matrix.os }} py${{ matrix.python-version }}" runs-on: ${{ matrix.os }} @@ -32,9 +32,11 @@ jobs: shell: bash -l {0} strategy: + fail-fast: false matrix: os: ["ubuntu-latest"] python-version: ["3.8"] + session: ["doctest", "gallery", "linkcheck"] env: IRIS_TEST_DATA_VERSION: "2.9" @@ -120,8 +122,8 @@ jobs: echo "image.cmap : viridis" >> ${MPL_RC} cat ${MPL_RC} - - name: "iris doctests and gallery" + - name: "iris doctests, gallery and linkcheck" env: PY_VER: ${{ matrix.python-version }} run: | - nox --session doctest -- --verbose + nox --session ${{ matrix.session }} -- --verbose diff --git a/README.md b/README.md index 686a4558c6..1217cd9b38 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,6 @@ ci-docs-tests - -ci-docs-linkcheck Documentation Status diff --git a/noxfile.py b/noxfile.py index 5838ea5fab..2b1df8fb00 100755 --- a/noxfile.py +++ b/noxfile.py @@ -220,7 +220,22 @@ def doctest(session: nox.sessions.Session): "doctest", external=True, ) - session.cd("..") + + +@nox.session(python=_PY_VERSION_DOCSBUILD, venv_backend="conda") +def gallery(session: nox.sessions.Session): + """ + Perform iris gallery doc-tests. + + Parameters + ---------- + session: object + A `nox.sessions.Session` object. + + """ + prepare_venv(session) + session.install("--no-deps", "--editable", ".") + session.env.update(ENV) session.run( "python", "-m", From af54fa9556a49264b3d90b5612632a6aa98659a9 Mon Sep 17 00:00:00 2001 From: Bill Little Date: Mon, 20 Jun 2022 12:18:26 +0100 Subject: [PATCH 2/5] update job name with session --- .github/workflows/ci-docs-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-docs-tests.yml b/.github/workflows/ci-docs-tests.yml index a41c797191..2b8b66b4ff 100644 --- a/.github/workflows/ci-docs-tests.yml +++ b/.github/workflows/ci-docs-tests.yml @@ -122,7 +122,7 @@ jobs: echo "image.cmap : viridis" >> ${MPL_RC} cat ${MPL_RC} - - name: "iris doctests, gallery and linkcheck" + - name: "iris ${{ matrix.session }}" env: PY_VER: ${{ matrix.python-version }} run: | From d87ccbbdae91d73f79a93c8ed8da713d4ca16349 Mon Sep 17 00:00:00 2001 From: Bill Little Date: Mon, 20 Jun 2022 14:20:29 +0100 Subject: [PATCH 3/5] add nox session as composite input --- .github/workflows/ci-docs-tests.yml | 1 + .github/workflows/ci-tests.yml | 8 +++++--- .github/workflows/composite/nox-cache/action.yml | 5 ++++- .../developers_guide/contributing_getting_involved.rst | 1 + docs/src/developers_guide/github_app.rst | 9 +++++++++ 5 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 docs/src/developers_guide/github_app.rst diff --git a/.github/workflows/ci-docs-tests.yml b/.github/workflows/ci-docs-tests.yml index 2b8b66b4ff..8b1212aa09 100644 --- a/.github/workflows/ci-docs-tests.yml +++ b/.github/workflows/ci-docs-tests.yml @@ -103,6 +103,7 @@ jobs: cache_build: 1 env_name: ${{ env.ENV_NAME }} lock_file: ${{ env.LOCK_FILE }} + session: ${{ matrix.session }} # TODO: drop use of site.cfg and explicit use of mplrc - name: "iris configure" diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 5598ce1084..6c33a381a1 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -23,7 +23,7 @@ concurrency: jobs: tests: - name: "tests ${{ matrix.os }} ${{ matrix.python-version }}" + name: "${{ matrix.session}} ${{ matrix.os }} ${{ matrix.python-version }}" runs-on: ${{ matrix.os }} @@ -36,6 +36,7 @@ jobs: matrix: os: ["ubuntu-latest"] python-version: ["3.8"] + session: ["tests"] env: IRIS_TEST_DATA_VERSION: "2.9" @@ -102,6 +103,7 @@ jobs: cache_build: 1 env_name: ${{ env.ENV_NAME }} lock_file: ${{ env.LOCK_FILE }} + session: ${{ matrix.session }} # TODO: drop use of site.cfg and explicit use of mplrc - name: "iris configure" @@ -115,8 +117,8 @@ jobs: echo "doc_dir = ${GITHUB_WORKSPACE}/docs" >> ${SITE_CFG} cat ${SITE_CFG} - - name: "iris tests" + - name: "iris ${{ matrix.session }}" env: PY_VER: ${{ matrix.python-version }} run: | - nox --session tests -- --verbose + nox --session ${{ matrix.session }} -- --verbose diff --git a/.github/workflows/composite/nox-cache/action.yml b/.github/workflows/composite/nox-cache/action.yml index 9d92ad7226..a981998f24 100644 --- a/.github/workflows/composite/nox-cache/action.yml +++ b/.github/workflows/composite/nox-cache/action.yml @@ -12,6 +12,9 @@ inputs: lock_file: description: "conda-lock environment requirements filename" required: true + session: + description: "nox session name" + required: true runs: using: "composite" @@ -19,4 +22,4 @@ runs: - uses: actions/cache@v3 with: path: ${{ github.workspace }}/.nox - key: ${{ runner.os }}-nox-${{ inputs.env_name }}-py${{ matrix.python-version }}-b${{ inputs.cache_build }}-${{ hashFiles(inputs.lock_file) }} + key: ${{ runner.os }}-nox-${{ inputs.env_name }}-s${{ matrix.session }}-py${{ matrix.python-version }}-b${{ inputs.cache_build }}-${{ hashFiles(inputs.lock_file) }} diff --git a/docs/src/developers_guide/contributing_getting_involved.rst b/docs/src/developers_guide/contributing_getting_involved.rst index f4e677cea2..9ec6559114 100644 --- a/docs/src/developers_guide/contributing_getting_involved.rst +++ b/docs/src/developers_guide/contributing_getting_involved.rst @@ -50,6 +50,7 @@ If you are new to using GitHub we recommend reading the contributing_documentation contributing_codebase_index contributing_changes + github_app release diff --git a/docs/src/developers_guide/github_app.rst b/docs/src/developers_guide/github_app.rst new file mode 100644 index 0000000000..3f50696154 --- /dev/null +++ b/docs/src/developers_guide/github_app.rst @@ -0,0 +1,9 @@ + +GitHub App Configuration +------------------------ + +.. note:: + + This section of the documentation is only applicable to GitHub SciTools Organisation + owners and administrators. + From a88639d4e0fb040519b05867eb5a897b7e38923e Mon Sep 17 00:00:00 2001 From: Bill Little Date: Tue, 21 Jun 2022 10:44:10 +0100 Subject: [PATCH 4/5] minor tweak --- .github/workflows/ci-tests.yml | 2 +- .../developers_guide/contributing_getting_involved.rst | 1 - docs/src/developers_guide/github_app.rst | 9 --------- 3 files changed, 1 insertion(+), 11 deletions(-) delete mode 100644 docs/src/developers_guide/github_app.rst diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 6c33a381a1..98e2afaf67 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -23,7 +23,7 @@ concurrency: jobs: tests: - name: "${{ matrix.session}} ${{ matrix.os }} ${{ matrix.python-version }}" + name: "${{ matrix.session }} ${{ matrix.os }} py${{ matrix.python-version }}" runs-on: ${{ matrix.os }} diff --git a/docs/src/developers_guide/contributing_getting_involved.rst b/docs/src/developers_guide/contributing_getting_involved.rst index 9ec6559114..f4e677cea2 100644 --- a/docs/src/developers_guide/contributing_getting_involved.rst +++ b/docs/src/developers_guide/contributing_getting_involved.rst @@ -50,7 +50,6 @@ If you are new to using GitHub we recommend reading the contributing_documentation contributing_codebase_index contributing_changes - github_app release diff --git a/docs/src/developers_guide/github_app.rst b/docs/src/developers_guide/github_app.rst deleted file mode 100644 index 3f50696154..0000000000 --- a/docs/src/developers_guide/github_app.rst +++ /dev/null @@ -1,9 +0,0 @@ - -GitHub App Configuration ------------------------- - -.. note:: - - This section of the documentation is only applicable to GitHub SciTools Organisation - owners and administrators. - From ea4cb2eaf5fab8c197039e4d9b438eb5dc86700e Mon Sep 17 00:00:00 2001 From: Bill Little Date: Mon, 27 Jun 2022 12:27:12 +0100 Subject: [PATCH 5/5] review action - tidy nox composite inputs --- .github/workflows/ci-docs-tests.yml | 1 - .github/workflows/ci-tests.yml | 1 - .github/workflows/composite/nox-cache/action.yml | 3 --- 3 files changed, 5 deletions(-) diff --git a/.github/workflows/ci-docs-tests.yml b/.github/workflows/ci-docs-tests.yml index 8b1212aa09..2b8b66b4ff 100644 --- a/.github/workflows/ci-docs-tests.yml +++ b/.github/workflows/ci-docs-tests.yml @@ -103,7 +103,6 @@ jobs: cache_build: 1 env_name: ${{ env.ENV_NAME }} lock_file: ${{ env.LOCK_FILE }} - session: ${{ matrix.session }} # TODO: drop use of site.cfg and explicit use of mplrc - name: "iris configure" diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 98e2afaf67..2863b45038 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -103,7 +103,6 @@ jobs: cache_build: 1 env_name: ${{ env.ENV_NAME }} lock_file: ${{ env.LOCK_FILE }} - session: ${{ matrix.session }} # TODO: drop use of site.cfg and explicit use of mplrc - name: "iris configure" diff --git a/.github/workflows/composite/nox-cache/action.yml b/.github/workflows/composite/nox-cache/action.yml index a981998f24..468dd22d81 100644 --- a/.github/workflows/composite/nox-cache/action.yml +++ b/.github/workflows/composite/nox-cache/action.yml @@ -12,9 +12,6 @@ inputs: lock_file: description: "conda-lock environment requirements filename" required: true - session: - description: "nox session name" - required: true runs: using: "composite"