Skip to content

Commit

Permalink
pybop-team#123 matrix script is working now, clean it up
Browse files Browse the repository at this point in the history
  • Loading branch information
agriyakhetarpal committed Feb 11, 2024
1 parent d09b537 commit 4d9d732
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/ci/build_matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@
# This helper script generates a matrix for further use in the
# scheduled/nightly builds for PyBOP, i.e., in scheduled_tests.yaml
# It generates a matrix of all combinations of the following variables:
# - python_version: 3.8, 3.9, 3.10, 3.11
# - python_version: 3.X
# - os: ubuntu-latest, windows-latest, macos-latest
# - pybamm_version: the last four versions of PyBaMM from PyPI
# - pybamm_version: the last four versions of PyBaMM from PyPI, excluding release candidates

# To update the matrix, the variables below can be modified as needed.

python_version=("3.8" "3.9" "3.10" "3.11")
os=("ubuntu-latest" "windows-latest" "macos-latest")
# This command fetches the last four PyBaMM versions excluding release candidates from PyPI
pybamm_version=($(curl -s https://pypi.org/pypi/pybamm/json | jq -r '.releases | keys[]' | grep -v rc | tail -n 4 | awk '{print "\"" $1 "\"" }' | paste -sd " " -))

# open dict
json='{
"include": [
'
Expand All @@ -37,5 +40,4 @@ json+='
]
}'

# escape "" quotes with \ and print the JSON output in one line
echo "$json" | jq -c .

0 comments on commit 4d9d732

Please sign in to comment.