1+ name : Build Python Services
2+
3+ on :
4+ push :
5+ branches : [develop, main]
6+ paths :
7+ - ' unicorn_contracts/**'
8+ - ' unicorn_approvals/**'
9+ - ' unicorn_web/**'
10+ pull_request :
11+ branches : [develop, main]
12+ paths :
13+ - ' unicorn_contracts/**'
14+ - ' unicorn_approvals/**'
15+ - ' unicorn_web/**'
16+
17+ jobs :
18+ build :
19+ runs-on : ubuntu-latest
20+ strategy :
21+ matrix :
22+ service : [unicorn_contracts, unicorn_approvals, unicorn_web]
23+ include :
24+ - service : unicorn_contracts
25+ display_name : Unicorn Contracts Service
26+ - service : unicorn_approvals
27+ display_name : Unicorn Approvals Service
28+ - service : unicorn_web
29+ display_name : Unicorn Web Service
30+
31+ steps :
32+ - name : Checkout code
33+ uses : actions/checkout@v4
34+
35+ - name : Set up Python 3.12
36+ uses : actions/setup-python@v4
37+ with :
38+ python-version : 3.12
39+
40+ - name : Install uv
41+ uses : astral-sh/setup-uv@v5
42+ with :
43+ version : 0.7.8
44+
45+ - name : Install AWS SAM CLI
46+ uses : aws-actions/setup-sam@v2
47+
48+ - name : Install cfn-lint
49+ run : |
50+ pip install cfn-lint
51+
52+ - name : Install yq
53+ run : |
54+ sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
55+ sudo chmod a+x /usr/local/bin/yq
56+
57+ - name : Initialize dependencies for ${{ matrix.display_name }}
58+ run : make ci_init
59+ working-directory : ./${{ matrix.service }}
60+
61+ - name : Build ${{ matrix.display_name }}
62+ run : make build
63+ working-directory : ./${{ matrix.service }}
64+ env :
65+ DOCKER_OPTS : --use-container
66+
67+ - name : Upload build artifacts for ${{ matrix.display_name }}
68+ uses : actions/upload-artifact@v4
69+ with :
70+ name : ${{ matrix.service }}-build-artifacts
71+ path : ${{ matrix.service }}/.aws-sam/
72+ retention-days : 7
73+
74+ - name : Clean up ${{ matrix.display_name }}
75+ run : make clean
76+ working-directory : ./${{ matrix.service }}
77+ if : always()
0 commit comments