diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 425e0a2f8c..6ade78290e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,6 +115,7 @@ jobs: BRANCH=${{ env.BRANCH }} cd covref + git pull origin coverage-reference git config user.name github-actions[bot] git config user.email "github-actions[bot]@users.noreply.github.com" @@ -160,7 +161,7 @@ jobs: }); - Sphinx-Pytest: + Pytest: runs-on: ubuntu-22.04 strategy: fail-fast: false @@ -209,13 +210,6 @@ jobs: safety check || true shell: micromamba-shell {0} - - name: sphinx documentation - run: | - micromamba install ipykernel - pip install . - make -C doc html SPHINXOPTS="-W --keep-going" - shell: micromamba-shell {0} - - name: pytest run: | pytest diff --git a/.github/workflows/master_update.yml b/.github/workflows/master_update.yml index 8ee44eeecd..a2ee25cc9e 100644 --- a/.github/workflows/master_update.yml +++ b/.github/workflows/master_update.yml @@ -14,7 +14,7 @@ jobs: - name: Checkout uses: actions/checkout@v6 with: - fetch-depth: 0 + fetch-depth: 1 - name: Substitute branch name in environment files run: | @@ -39,20 +39,24 @@ jobs: pytest --cov=improver --cov-report=term --cov-report=html | tee coverage_output.txt; test ${PIPESTATUS[0]} -eq 0 shell: micromamba-shell {0} + - name: Checkout reference coverage report + uses: actions/checkout@v6 + with: + fetch-depth: 1 + path: covref + ref: coverage-reference + - name: Commit and push coverage report run: | + cd covref git config user.name github-actions[bot] git config user.email "github-actions[bot]@users.noreply.github.com" - git worktree add /tmp/coverage-ref coverage-reference - - rm -rf /tmp/coverage-ref/master/ - mkdir /tmp/coverage-ref/master/ - - cp coverage_output.txt /tmp/coverage-ref/master/. - cp -r htmlcov/ /tmp/coverage-ref/master/. + rm -rf master/ + mkdir master/ - cd /tmp/coverage-ref + cp ../coverage_output.txt master/. + cp -r ../htmlcov/ master/. git add -f master/ # identify directories who's creation date is older than 14 days (excluding master/) and remove them diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml deleted file mode 100644 index 4567731321..0000000000 --- a/.github/workflows/scheduled.yml +++ /dev/null @@ -1,171 +0,0 @@ -# Note that this file intentionally uses no cache, see -# https://github.com/metoppv/improver/pull/1651#issue-1108889073 -name: Scheduled Tests - -on: - schedule: - - cron: '7 4 * * *' - workflow_dispatch: - -jobs: - Sphinx-Pytest-Coverage: - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - env: [latest] - - if: github.repository_owner == 'metoppv' - steps: - - - uses: actions/checkout@v6 - - - name: Substitute branch name in environment files - run: | - # For scheduled runs, use the branch name (typically master) - BRANCH_NAME=${GITHUB_REF#refs/heads/} - echo "Using BRANCH_NAME: $BRANCH_NAME" - # Replace BRANCH_NAME placeholder in all environment files - sed -i "s/\${BRANCH_NAME}/$BRANCH_NAME/g" envs/latest.yml - shell: bash - - - name: Environment creation - uses: mamba-org/setup-micromamba@v2 - with: - environment-file: envs/${{ matrix.env }}.yml - init-shell: bash - cache-environment: true - - - name: Environment info - run: | - micromamba info - micromamba list - shell: bash -el {0} - - - name: sphinx documentation - run: | - make -C doc html SPHINXOPTS="-W --keep-going" - shell: micromamba-shell {0} - - - name: pytest without coverage - run: | - pytest - shell: micromamba-shell {0} - - Safety: - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - env: [latest] - - if: github.repository_owner == 'metoppv' - steps: - - - uses: actions/checkout@v6 - - - name: Substitute branch name in environment files - run: | - # For scheduled runs, use the branch name (typically master) - BRANCH_NAME=${GITHUB_REF#refs/heads/} - echo "Using BRANCH_NAME: $BRANCH_NAME" - # Replace BRANCH_NAME placeholder in all environment files - sed -i "s/\${BRANCH_NAME}/$BRANCH_NAME/g" envs/latest.yml - shell: bash - - - name: Environment creation - uses: mamba-org/setup-micromamba@v2 - with: - environment-file: envs/${{ matrix.env }}.yml - init-shell: bash - cache-environment: true - - - name: Environment info - run: | - micromamba info - micromamba list - shell: bash -el {0} - - - name: safety - run: | - micromamba install safety - safety check || true - shell: micromamba-shell {0} - - Type-checking: - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - env: [latest] - - if: github.repository_owner == 'metoppv' - steps: - - - uses: actions/checkout@v6 - - - name: Substitute branch name in environment files - run: | - # For scheduled runs, use the branch name (typically master) - BRANCH_NAME=${GITHUB_REF#refs/heads/} - echo "Using BRANCH_NAME: $BRANCH_NAME" - # Replace BRANCH_NAME placeholder in all environment files - sed -i "s/\${BRANCH_NAME}/$BRANCH_NAME/g" envs/latest.yml - shell: bash - - - name: Environment creation - uses: mamba-org/setup-micromamba@v2 - with: - environment-file: envs/${{ matrix.env }}.yml - init-shell: bash - cache-environment: true - - - name: Environment info - run: | - micromamba info - micromamba list - shell: bash -el {0} - - - name: mypy - run: | - mypy improver || true - shell: micromamba-shell {0} - - pre-commit-checks: - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - steps: - - - name: improver checkout - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: 3.9 - cache: 'pip' - - - name: pip install pre-commit - run: | - pip install pre-commit - - - name: Python interpreter version sha (PYSHA) - run: echo "PYSHA=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV - - - name: Cache pre-commit - uses: actions/cache@v5 - id: pre-commit-cache - with: - path: ~/.cache/pre-commit - key: pre-commit|${{ env.PYSHA }}|${{ hashFiles('.pre-commit-config.yaml') }} - - - name: pre-commit install - run: | - pre-commit install - - - name: pre-commit run - run: | - pre-commit run --verbose --color=always --all-files \ No newline at end of file diff --git a/envs/latest.yml b/envs/latest.yml index 0bf9d1df3c..cf85152d5a 100644 --- a/envs/latest.yml +++ b/envs/latest.yml @@ -36,10 +36,9 @@ dependencies: - pytest-cov - pytest-xdist - sphinx-autodoc-typehints - - sphinx-book-theme + - sphinx-book-theme - sphinx-gallery - threadpoolctl - - pytest-xdist - pip - pip: - - git+https://github.com/metoppv/improver_example_data.git@${BRANCH_NAME} + - git+https://github.com/metoppv/improver_example_data.git@${BRANCH_NAME}