Skip to content

Commit

Permalink
feat(validator): Add workflow to run validator tests
Browse files Browse the repository at this point in the history
This PR adds a workflow to run validator tests on CI
It also adds a make target which can be used to run tests
locally as well as on CI

Signed-off-by: Vibhu Prashar <[email protected]>
  • Loading branch information
vprashar2929 committed Jul 1, 2024
1 parent ca43009 commit 0d21c46
Show file tree
Hide file tree
Showing 3 changed files with 48 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
36 changes: 36 additions & 0 deletions .github/workflows/validator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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
# 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 0d21c46

Please sign in to comment.