diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index e12585f667..1670d58a47 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -23,42 +23,45 @@ jobs: pytest: strategy: matrix: - include: # One job per OS; latest python version testable on GitHub actions. # These should match the versions used in the "pytest" workflows of both # ixmp and message_ix. - - os: macos-latest - python-version: "3.10" - - os: ubuntu-latest - python-version: "3.10" - - os: windows-latest - python-version: "3.9" + version: + - { os: macos-latest, python: "3.10" } + - { os: ubuntu-latest, python: "3.10" } + - { os: windows-latest, python: "3.9" } + upstream-version: + - v3.2.0 # Minimum version given in setup.cfg + - v3.5.0 # Latest released version + - main # Development version fail-fast: false - runs-on: ${{ matrix.os }} - name: ${{ matrix.os }}-py${{ matrix.python-version }} + runs-on: ${{ matrix.version.os }} + name: ${{ matrix.version.os }}-py${{ matrix.version.python }}-upstream-${{ matrix.upstream-version }} steps: - name: Cancel previous runs that have not completed uses: styfle/cancel-workflow-action@0.9.1 - name: Check out ixmp - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: iiasa/ixmp + ref: ${{ matrix.upstream-version }} path: ixmp fetch-depth: ${{ env.depth }} - name: Check out message-ix - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: iiasa/message_ix + ref: ${{ matrix.upstream-version }} path: message-ix fetch-depth: ${{ env.depth }} - name: Check out message-ix-models - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: message-ix-models fetch-depth: ${{ env.depth }} @@ -70,20 +73,21 @@ jobs: (cd message-ix-models; git fetch --tags --depth=${{ env.depth }}) shell: bash - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v3 with: - python-version: ${{ matrix.python-version }} + python-version: ${{ matrix.version.python }} + + - name: Locate pip cache directory + id: pip-cache + run: echo "::set-output name=dir::$(pip cache dir)" - name: Cache Python packages and GAMS installer - uses: actions/cache@v2 + uses: actions/cache@v3 with: - path: | - ~/.cache/pip - ~/Library/Caches/pip - ~/appdata/local/pip/cache - key: ${{ matrix.os }}-py${{ matrix.python-version }} + path: ${{ steps.pip-cache.outputs.dir }} + key: ${{ matrix.version.os }}-py${{ matrix.version.python }} restore-keys: | - ${{ matrix.os }}- + ${{ matrix.version.os }} - uses: iiasa/actions/setup-gams@main with: @@ -104,12 +108,12 @@ jobs: run: pytest message_ix_models -rA --verbose --color=yes --cov-report=xml --cov-report=term-missing - name: Test documentation build using Sphinx - if: ${{ startsWith(matrix.os, 'ubuntu') }} + if: startsWith(matrix.os, 'ubuntu') env: RTD_TOKEN_MESSAGE_DATA: ${{ secrets.RTD_TOKEN_MESSAGE_DATA }} run: make --directory=message-ix-models/doc html - name: Upload test coverage to Codecov.io - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 with: directory: message-ix-models