Unidata/MetPy

View on GitHub
.github/workflows/unstable-builds.yml

Summary

Maintainability
Test Coverage
name: Unstable Builds

on:
  workflow_call:
    outputs:
      tests_result:
        description: "Result from running tests"
        value: ${{ jobs.Tests.outputs.result }}
      docs_result:
        description: "Result from running docs"
        value: ${{ jobs.Docs.outputs.result }}

jobs:
  Tests:
    runs-on: ubuntu-20.04
    outputs:
      result: ${{ steps.tests.outcome }}
    steps:
    - name: Checkout source
      uses: actions/checkout@v4
      with:
        fetch-depth: 150
        fetch-tags: true

    - name: Assemble test requirements
      run: |
        echo git+https://github.com/hgrecco/pint@master#egg=pint >> ci/test_requirements.txt
        echo git+https://github.com/pydata/xarray@main#egg=xarray >> ci/test_requirements.txt

    - name: Install using PyPI
      uses: ./.github/actions/install-pypi
      with:
        need-extras: true
        type: test
        version-file: Prerelease
        python-version: 3.12

    - name: Run tests
      id: tests
      uses: ./.github/actions/run-tests
      with:
        run-doctests: false
        key: nightly
        upload-coverage: false

    - name: Upload test log
      if: failure()
      uses: actions/upload-artifact@v4
      with:
        name: log-nightly-tests
        path: tests-nightly.log
        retention-days: 5

  Docs:
    runs-on: ubuntu-20.04
    outputs:
      result: ${{ steps.build.outcome }}
    steps:
    - name: Checkout source
      uses: actions/checkout@v4
      with:
        fetch-depth: 150
        fetch-tags: true

    - name: Assemble doc requirements
      run: |
        echo git+https://github.com/hgrecco/pint@master#egg=pint >> ci/doc_requirements.txt
        echo git+https://github.com/pydata/xarray@main#egg=xarray >> ci/doc_requirements.txt

    - name: Install using PyPI
      uses: ./.github/actions/install-pypi
      with:
        type: doc
        version-file: Prerelease
        python-version: 3.12

    - name: Build docs
      id: build
      uses: ./.github/actions/build-docs
      with:
        run-linkchecker: true
        key: nightly

    - name: Upload build log
      if: failure()
      uses: actions/upload-artifact@v4
      with:
        name: log-nightly-docs
        path: |
          build.log
          linkchecker.log
        retention-days: 5