-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Test against multiple versions of ixmp and message_ix. - Bump versions for third party actions: actions/cache v2 → v3 actions/checkout v2 → v3 actions/setup-python v2 → v3 codecov/codecov-action v2 → v3
- Loading branch information
Showing
1 changed file
with
27 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected] | ||
|
||
- 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 |