generated from ghga-de/microservice-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 1.76 KB
/
monorepo_tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Monorepo Tests
on: push
jobs:
check-changes:
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: 0
- name: Fetch latest main for comparison
id: fetch-latest-main
run: git fetch --depth=1 origin main:main
- 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/affected_services.py)" >> $GITHUB_OUTPUT
test:
if: ${{needs.check-changes.outputs.services}}
needs: check-changes
runs-on: ubuntu-latest
strategy:
matrix:
service: ${{ fromJson(needs.check-changes.outputs.services) }}
fail-fast: false
env:
IFRS_CONFIG_YAML: ./services/ifrs/.dev/.dev_config.yaml
IRS_CONFIG_YAML: ./services/irs/.dev/.dev_config.yaml
PCS_CONFIG_YAML: ./services/pcs/.dev/.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}}