Skip to content

Commit

Permalink
Add README.md for action/parse-ci-config
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-basevi committed Jun 6, 2024
1 parent 51138a3 commit cebf862
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 15 deletions.
40 changes: 40 additions & 0 deletions .github/actions/parse-ci-config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# parse-ci-config

This action parses the CI testing configuration file. The caller of the action needs to checkout the branch where the config file is defined before running this action.

## Inputs

| Name | Type | Description | Required | Example |
| ---- | ---- | ----------- | -------- | ------- |
| check | `string` | The type of check/test to run | true | `scheduled` |
| branch-or-tag | `string` | The name of git branch or tag | true | `release-1deg_jra55_ryf-2.0` |
| config-filepath | `string` | Path to configuration file | true | `config/ci.json` |

## Outputs

| Name | Type | Description | Example |
| ---- | ---- | ----------- | -------- |
| markers | `string` | Markers used for the pytest checks, in the python format | `checksum` |
| model-config-tests-version | `string` | The version of the model-config-tests | `0.0.1` |
| python-version | `string` | The python version used to create test virtual environment | `3.11.0` |

## Example usage

```yaml
# ---------
steps:
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main

- name: Read scheduled test config
id: scheduled-config
uses: access-nri/access-om2-configs/.github/actions/parse-ci-config@main
with:
check: scheduled
branch-or-tag: "release-1deg_jra55_ryf-2.0"
config-filepath: "config/ci.json"
```
18 changes: 3 additions & 15 deletions README-DEV.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,24 +134,12 @@ This is the `config/ci.json` configuration file for specifying different test ma
- `reproducibility`: These are reproducibility tests are run as part of [`pr-1-ci.yml`](#repro-ci). The keys under these tests represent the target branches into which pull requests are being merged.
- `qa` - These are quick QA tests are run as part of [`pr-1-ci.yml`](#qa-ci). The keys under these tests represent the target branches into which pull requests are being merged.

As most of the tests use the same test and python versions, and similar markers, there are two levels of defaults. There's a default at test type level which is useful for defining test markers - this selects certain pytests to run in `model-config-tests`. There is an outer global default, which is used if a property is not defined for a given branch/tag and it is not defined for the test default.

#### parse-ci-config

This action parses the CI testing configuration file. The caller of the action needs to checkout the branch where the config file is defined before running this action.

#### Inputs

| Name | Type | Description | Required | Example |
| ---- | ---- | ----------- | -------- | ------- |
| check | `string` | The type of check/test to run | true | `scheduled` |
| branch-or-tag | `string` | The name of git branch or tag | true | 'release-1deg_jra55_ryf-2.0' |
| config-filepath | `string` | Path to configuration file | true | `config/ci.json` |

#### Outputs
The configuration properties needed to run the tests are:

| Name | Type | Description | Example |
| ---- | ---- | ----------- | -------- |
| markers | `string` | Markers used for the pytest checks, in the python format | `checksum` |
| model-config-tests-version | `string` | The version of the model-config-tests | `0.0.1` |
| python-version | `string` | The python version used to create test virtual environment | `3.11.0` |

As most of the tests use the same test and python versions, and similar markers, there are two levels of defaults. There's a default at test type level which is useful for defining test markers - this selects certain pytests to run in `model-config-tests`. There is an outer global default, which is used if a property is not defined for a given branch/tag, and it is not defined for the test default. The `parse-ci-config` action applies the fall-back default logic. For more information on using this action see [`parse-ci-config` README.md](./.github/actions/parse-ci-config/README.md).

0 comments on commit cebf862

Please sign in to comment.