generated from ghga-de/microservice-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
.github/workflows/monorepo_tests.yaml → .github/workflows/tests_on_pr.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
name: Monorepo Tests | ||
|
||
on: push | ||
on: pull_request | ||
|
||
jobs: | ||
get-changed-services: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Monorepo Tests | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- main | ||
|
||
jobs: | ||
get-changed-services: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
services: ${{ steps.services-changed.outputs.affected }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
filter: tree:0 | ||
fetch-depth: 2 | ||
|
||
- name: Changed Files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v44.3.0 | ||
|
||
- name: Install Typer to check changed services | ||
id: install-typer | ||
run: pip install typer>=0.9.0 | ||
|
||
- name: Generate list of changed services | ||
id: services-changed | ||
run: | | ||
echo "affected=$(python3 ./scripts/get_affected_services.py --changed-files ${{ steps.changed-files.outputs.all_changed_files }} )" >> $GITHUB_OUTPUT | ||
test: | ||
needs: get-changed-services | ||
if: ${{needs.get-changed-services.outputs.services}} != "[]" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
service: ${{ fromJson(needs.get-changed-services.outputs.services) }} | ||
fail-fast: false | ||
env: | ||
IFRS_CONFIG_YAML: ./services/ifrs/dev_config.yaml | ||
IRS_CONFIG_YAML: ./services/irs/dev_config.yaml | ||
PCS_CONFIG_YAML: ./services/pcs/dev_config.yaml | ||
steps: | ||
- name: Checkout ${{matrix.service}} | ||
uses: actions/checkout@v4 | ||
with: | ||
filter: tree:0 | ||
fetch-depth: 0 | ||
|
||
- name: Update pip and pyopenssl | ||
id: pip-update | ||
run: python -m pip install --upgrade pip && pip install --upgrade pyopenssl | ||
|
||
- name: Install global and local dependencies for ${{matrix.service}} | ||
id: install-dependencies | ||
run: pip install --no-deps -r ./lock/requirements-dev.txt && pip install --no-deps ./services/${{matrix.service}} | ||
|
||
- name: Run tests for ${{matrix.service}} | ||
id: run-tests | ||
run: pytest ./services/${{matrix.service}} |