Skip to content

Commit

Permalink
Merge pull request #21 from PADAS/gundi-3264
Browse files Browse the repository at this point in the history
execute unit test on PR
  • Loading branch information
daniefdz authored Jul 18, 2024
2 parents 6ed4236 + 4e72fd4 commit f551a6c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 18 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Run tests
on:
workflow_call

jobs:
run_unit_tests:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install pip
run: python -m ensurepip --upgrade
- name: Install pip tools
run: pip install pip-tools
- name: Install compile dependencies
run: pip-compile --output-file=requirements.txt requirements-base.in requirements-dev.in requirements.in
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run unit tests
run: pytest
19 changes: 1 addition & 18 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,7 @@ jobs:
echo "tf_file_prod=environments/prod/integrations/${{ github.event.repository.name }}/terragrunt.hcl" >> $GITHUB_OUTPUT
run_unit_tests:
runs-on: ubuntu-latest
needs: [vars]
steps:
- name: Checkout branch
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install pip
run: python -m ensurepip --upgrade
- name: Install pip tools
run: pip install pip-tools
- name: Install compile dependencies
run: pip-compile --output-file=requirements.txt requirements-base.in requirements-dev.in requirements.in
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run unit tests
run: pytest
uses: ./.github/workflows/_tests.yml

build:
uses: PADAS/gundi-workflows/.github/workflows/build_docker.yml@v2
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: Test integration
on:
pull_request

jobs:
pr_unit_tests:
uses: ./.github/workflows/_tests.yml

0 comments on commit f551a6c

Please sign in to comment.