Skip to content

Commit

Permalink
Merge pull request #357 from esciencecenter-digital-skills/improve_sc…
Browse files Browse the repository at this point in the history
…aling_with_buil_matrices_gcroci2

clarify the mail.yml file structure when matrices are added
  • Loading branch information
anenadic authored May 14, 2024
2 parents 2cf9f31 + 2e44432 commit 889d940
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions _episodes/23-continuous-integration-automated-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,29 +360,40 @@ to refer to the values from the matrix.
So, our `.github/workflows/main.yml` should look like the following:

~~~
...
# Same key-value pairs as in "Defining Our Workflow" section
name: CI
on: push
jobs:
build:
# Here we add the matrices definition:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.10", "3.11"]
# Here we add the reference to the os matrix values
runs-on: {% raw %}${{ matrix.os }}{% endraw %}
...
# a job is a seq of steps
# Same key-value pairs as in "Defining Our Workflow" section
steps:
# Next we need to checkout out repository, and set up Python
# A 'name' is just an optional label shown in the log - helpful to clarify progress - and can be anything
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
# Here we add the reference to the python-version matrix values
python-version: {% raw %}${{ matrix.python-version }}{% endraw %}
...
# Same steps as in "Defining Our Workflow" section
- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
- name: Test with PyTest
run: |
python3 -m pytest --cov=catchment.models tests/test_models.py
~~~
{: .language-yaml}

Expand Down

0 comments on commit 889d940

Please sign in to comment.