Skip to content

Commit

Permalink
Release of optimade-validator-action v2 (#23)
Browse files Browse the repository at this point in the history
* Update README for action v2

* Apply suggestions from code review

* Update README with versions sections

New section "Concerning action versions and `optimade-python-tools`".
This tries to outline which versions of the `optimade` package are valid
for each of the major action versions (also correlating with the valid
OPTIMADE API versions).

* Update README.md
* Remove temporary optimade-python-tools versions

Co-authored-by: Casper Welzel Andersen <casper.andersen@epfl.ch>
  • Loading branch information
ml-evs and CasperWA committed Jul 17, 2020
1 parent 4d7628c commit f9dfdab
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 24 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/validator_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
with:
port: 3213
path: /v1
validator version: master

validator_index:
runs-on: ubuntu-latest
Expand All @@ -49,7 +48,6 @@ jobs:
port: 3214
path: /v1
index: yes
validator version: master

all_versioned_paths:
runs-on: ubuntu-latest
Expand All @@ -71,15 +69,13 @@ jobs:
port: 3213
path: /
all versioned paths: yes
validator version: master

- name: Run action (setting path to empty string)
uses: ./
with:
port: 3213
path: ""
all versioned paths: yes
validator version: master

bats:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -113,4 +109,4 @@ jobs:
with:
port: 3213
path: /v1
validator version: 38d822c73f3ca47986ada1e5e88f5fbdb6bdfd94
validator version: c6551e27f64abdaa94afd401db22af9ef2afd23d
48 changes: 30 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
# GitHub Action - OPTIMADE validator

[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-v1-undefined.svg?logo=github&logoColor=white&style=flat)](https://github.com/marketplace/actions/optimade-validator)
[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-v2-undefined.svg?logo=github&logoColor=white&style=flat)](https://github.com/marketplace/actions/optimade-validator)

This action runs `optimade-validator` from the `optimade` package found in the [`optimade-python-tools` repository](https://github.com/Materials-Consortia/optimade-python-tools) on either a locally running server or a public server.

All minor and patch updates to v1 will be folded into the `v1` tag, so that using the action `@v1` is recommended, since it results in using the latest v1.minor.patch.
All minor and patch updates to v2 will be folded into the `v2` tag, so that using the action `@v2` is recommended, since it results in using the latest v2.minor.patch.

Latest versions:

| Used tag | Effective version |
| :---: | :---: |
| `v1` | [`v1.1.0`](https://github.com/Materials-Consortia/optimade-validator-action/releases/tag/v1.1.0)
| `v2` | [`v2.0.0`](https://github.com/Materials-Consortia/optimade-validator-action/releases/tag/v2.0.0)
| `v1` | [`v1.2.0`](https://github.com/Materials-Consortia/optimade-validator-action/releases/tag/v1.2.0)

## Example usage

To run `optimade-validator` for an index meta-database at `http://gh_actions_host:5001/v1` do the following:
Within the same job, first, start a server, e.g., using the `docker-compose.yml` setup from this repository, and then add the step

```yml
uses: Materials-Consortia/optimade-validator-action@v1
uses: Materials-Consortia/optimade-validator-action@v2
with:
port: 5001
path: /v1
Expand All @@ -32,7 +33,7 @@ To run `optimade-validator` for a regular OPTIMADE _deployed_ implementation, te
- `https://example.org:443/optimade/example/v1.0.0`

```yml
uses: Materials-Consortia/optimade-validator-action@v1
uses: Materials-Consortia/optimade-validator-action@v2
with:
protocol: https
domain: example.org
Expand All @@ -43,19 +44,19 @@ with:

## Inputs

| Input | Description | Usage | Default |
| :---: | :--- | :---: | :---: |
| `all_versioned_paths` | Whether to test all possible versioned base URLs:<br><br>/vMAJOR<br>/vMAJOR.MINOR<br>/vMAJOR.MINOR.PATCH<br><br>If this is `'true'`, the input `'path'` MUST exempt the version part (e.g., `'/optimade'` instead of `'/optimade/v1'`).<br>If this is `'false'`, the input `'path'` MUST include the version part (e.g., `'/optimade/v1'` instead of `'/optimade'`) | Optional | `false`
| `as_type` | Validate the request URL with the provided type, rather than scanning the entire implementation<br>Example values: 'structures', 'reference'. For a full list of values see `optimade-python-tools`. | Optional | -
| `domain` | Domain for the OPTIMADE URL (defaults to the GitHub Actions runner host) | Optional | `gh_actions_host`
| `fail_fast` | Whether or not to exit and return a non-zero error code on first failure. | Optional | `false`
| `index` | Whether or not this is an index meta-database | Optional | `false`
| `path` | Path for the OPTIMADE (versioned) base URL - MUST start with `/`<br>_Note_: If `all versioned paths` is `true`, this MUST be un-versioned, e.g., `/optimade` or `/`, otherwise it MUST be versioned, e.g., the default value | Optional | `/v1`
| `port` | Port for the OPTIMADE URL | Optional | `5000`
| `protocol` | Protocol for the OPTIMADE URL | Optional | `http`
| `skip_optional` | Whether or not to skip tests for optional features. | Optional | `false`
| `validator_version` | Full version of an OPTIMADE Python tools release to PyPI, e.g., `'v0.6.0'` or `'0.3.4'`, which hosts the `optimade-validator`. It can also be a branch, tag, or git commit to use from the GitHub repository, e.g., `'master'` or `'5a5e903'`.<br>See [the pip documentation](https://pip.pypa.io/en/latest/reference/pip_install/#git) for more information of what is allowed here.<br>Finally, it may also be `'latest'` (default), which is understood to be the latest official release of the `optimade` package on PyPI.<br>Note, for the latest development version, choose `'master'`. | **Required** | `latest`
| `verbosity` | The verbosity of the output.<br>`0`: minimalistic, `1`: informational, `2`+: debug | Optional | `1`
| Input | Description | Usage | Default | Action version |
| :---: | :--- | :---: | :---: | :---: |
| `all_versioned_paths` | Whether to test all possible versioned base URLs:<br><br>/vMAJOR<br>/vMAJOR.MINOR<br>/vMAJOR.MINOR.PATCH<br><br>If this is `'true'`, the input `'path'` MUST exempt the version part (e.g., `'/optimade'` instead of `'/optimade/v1'`).<br>If this is `'false'`, the input `'path'` MUST include the version part (e.g., `'/optimade/v1'` instead of `'/optimade'`) | Optional | `false` | `v1+`
| `as_type` | Validate the request URL with the provided type, rather than scanning the entire implementation<br>Example values: 'structures', 'reference'. For a full list of values see `optimade-python-tools`. | Optional | - | `v1+`
| `domain` | Domain for the OPTIMADE URL (defaults to the GitHub Actions runner host) | Optional | `gh_actions_host` | `v1+`
| `fail_fast` | Whether or not to exit and return a non-zero error code on first failure. | Optional | `false` | `v2+`
| `index` | Whether or not this is an index meta-database | Optional | `false` | `v1+`
| `path` | Path for the OPTIMADE (versioned) base URL - MUST start with `/`<br>_Note_: If `all versioned paths` is `true`, this MUST be un-versioned, e.g., `/optimade` or `/`, otherwise it MUST be versioned, e.g., the default value | Optional | `/v1` | `v1+`
| `port` | Port for the OPTIMADE URL | Optional | `5000` | `v1+`
| `protocol` | Protocol for the OPTIMADE URL | Optional | `http` | `v1+`
| `skip_optional` | Whether or not to skip tests for optional features. | Optional | `false` | `v2+`
| `validator_version` | Full version of an OPTIMADE Python tools release to PyPI, e.g., `'v0.6.0'` or `'0.3.4'`, which hosts the `optimade-validator`. It can also be a branch, tag, or git commit to use from the GitHub repository, e.g., `'master'` or `'5a5e903'`.<br>See [the pip documentation](https://pip.pypa.io/en/latest/reference/pip_install/#git) for more information of what is allowed here.<br>Finally, it may also be `'latest'` (default), which is understood to be the latest official release of the `optimade` package on PyPI.<br>Note, for the latest development version, choose `'master'`. | **Required** | `latest` | `v1+`
| `verbosity` | The verbosity of the output.<br>`0`: minimalistic, `1`: informational, `2`+: debug | Optional | `1` | `v1+`

## Running test suite (developers)

Expand Down Expand Up @@ -105,3 +106,14 @@ Another is the relative or absolute path to the `.bats` files directory or a sin
```

will run the tests in the `test_verbosity.bats` file under the `tests` directory relative to where you're running the `run_tests.sh` file.

## Concerning action versions and `optimade-python-tools`

Since this action installs [`optimade-python-tools`](https://github.com/Materials-Consortia/optimade-python-tools) and runs the validator from this repository, the versions of this Action relies on different versions of the `optimade` package in the `optimade-python-tools` repository.

To keep it simple, this overview will only consider the major versions of this Action:

| Action version | `optimade` package versions | Supported OPTIMADE API specification version(s) |
| :---: | :---: | :---: |
| [`v2`](https://github.com/Materials-Consortia/optimade-validator-action/releases/tag/v2.0.0) | [`v0.10.0`](https://github.com/Materials-Consortia/optimade-python-tools/releases/v0.10.0)+ | [`v1.0.0`](https://github.com/Materials-Consortia/OPTIMADE/blob/v1.0.0/optimade.rst) |
| [`v1`](https://github.com/Materials-Consortia/optimade-validator-action/releases/tag/v1.2.0) | [`v0.7.0`](https://github.com/Materials-Consortia/optimade-python-tools/releases/v0.7.0) - [`v0.9.8`](https://github.com/Materials-Consortia/optimade-python-tools/releases/v0.9.8) | [`v0.10.0`](https://github.com/Materials-Consortia/OPTIMADE/blob/v0.10.0/optimade.md) - [`v1.0.0-rc2`](https://github.com/Materials-Consortia/OPTIMADE/blob/v1.0.0-rc2/optimade.rst) |
2 changes: 1 addition & 1 deletion tests/test_fixtures.bash
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function setup() {
export INPUT_INDEX=false
export INPUT_PATH=/v1
export INPUT_PROTOCOL=http
export INPUT_VALIDATOR_VERSION=master
export INPUT_VALIDATOR_VERSION=latest
export INPUT_VERBOSITY=1
export INPUT_FAIL_FAST=false
export INPUT_SKIP_OPTIONAL=false
Expand Down

0 comments on commit f9dfdab

Please sign in to comment.