Skip to content

Commit

Permalink
feat(validator): Add workflow for validator tests (#1570)
Browse files Browse the repository at this point in the history
This PR introduces a workflow to execute validator tests on CI
Additionally, it includes a Makefile within `e2e/tools/validator`
enabling the execution of targets such as `make fmt` and `make test` for local testing

Signed-off-by: Vibhu Prashar <[email protected]>
  • Loading branch information
vprashar2929 authored Jul 3, 2024
1 parent 3e1174f commit 91fc8d4
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
# for each PR run integration test
integration_test:
uses: ./.github/workflows/integration_test.yml
# for each PR run validator test
validator:
uses: ./.github/workflows/validator.yml

changes_image:
runs-on: ubuntu-latest
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/validator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Validator tests

on: # yamllint disable-line rule:truthy
workflow_call:

jobs:
test:
runs-on: ubuntu-latest
steps:
# checkout source code
- name: checkout source
uses: actions/[email protected]

# setup Python environment
- name: set up Python
uses: actions/[email protected]
with:
python-version: "3.11"

# install hatch
- name: install hatch
run: |
python -m pip install --upgrade pip
pip install hatch
# run the formatter using hatch
- name: run formatter with hatch
run: |
cd ./e2e/tools/validator
make fmt
git diff --exit-code
# run the tests using hatch
- name: run tests with hatch
run: |
cd ./e2e/tools/validator
make test
9 changes: 9 additions & 0 deletions e2e/tools/validator/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.PHONY: test
test:
@echo "running hatch test"
hatch test

.PHONY: fmt
fmt:
@echo "running hatch fmt"
hatch fmt -f

0 comments on commit 91fc8d4

Please sign in to comment.