-
-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (77 loc) · 2.63 KB
/
pull_request.yaml
File metadata and controls
92 lines (77 loc) · 2.63 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Pull request
on:
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
continuous-integration:
if: github.actor != 'dependabot[bot]'
runs-on: ubuntu-24.04
outputs:
docker-tag: ${{ steps.docker-tag.outputs.docker-tag }}
env:
UV_NO_SYNC: 1
WIRIO_ENVIRONMENT: development
steps:
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Install uv
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
with:
version-file: pyproject.toml
resolution-strategy: lowest
- name: Install Python
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version-file: .python-version
- name: Install Python packages
run: uv sync --locked
shell: bash
- name: Check code
run: make check-code
shell: bash
- name: Unit tests
run: uv run -- pytest --cov=python_template --cov-branch tests/unit
shell: bash
- name: Integration tests
if: false
run: uv run -- pytest --cov=python_template --cov-branch --cov-append tests/integration
shell: bash
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Set docker tag
id: docker-tag
run: echo "docker-tag=myregistry/python-template:${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT
- name: Build and push
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
file: src/python_template/api/Dockerfile
tags: ${{ steps.docker-tag.outputs.docker-tag }}
push: false
deploy-dev:
name: Deploy to development
needs: continuous-integration
uses: ./.github/workflows/_deploy.yaml
with:
environment: dev
docker_tag: ${{ needs.continuous-integration.outputs.docker-tag }}
secrets: inherit
deploy-stg:
name: Deploy to staging
needs: [continuous-integration, deploy-dev]
uses: ./.github/workflows/_deploy.yaml
with:
environment: stg
docker_tag: ${{ needs.continuous-integration.outputs.docker-tag }}
secrets: inherit
deploy-prd:
name: Deploy to production
needs: [continuous-integration, deploy-stg]
uses: ./.github/workflows/_deploy.yaml
with:
environment: prd
docker_tag: ${{ needs.continuous-integration.outputs.docker-tag }}
secrets: inherit