Skip to content

Commit d82e392

Browse files
committed
add API CI
1 parent 10148ef commit d82e392

File tree

1 file changed

+115
-0
lines changed

1 file changed

+115
-0
lines changed

.github/workflows/api-ci.yml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
name: API CI
2+
3+
on:
4+
push:
5+
tags:
6+
- prod-*
7+
branches:
8+
- main
9+
- staging
10+
paths:
11+
- 'apps/codecov-api/**'
12+
- 'apps/codecov-api'
13+
- 'libs/**'
14+
pull_request:
15+
paths:
16+
- 'apps/codecov-api/**'
17+
- 'apps/codecov-api'
18+
- 'libs/**'
19+
merge_group:
20+
paths:
21+
- 'apps/codecov-api/**'
22+
- 'apps/codecov-api'
23+
- 'libs/**'
24+
25+
permissions:
26+
contents: "read"
27+
id-token: "write"
28+
issues: "write"
29+
pull-requests: "write"
30+
31+
concurrency:
32+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
33+
cancel-in-progress: true
34+
35+
jobs:
36+
api-lint:
37+
name: Run Lint (API)
38+
uses: codecov/gha-workflows/.github/workflows/lint.yml@pr41
39+
with:
40+
working_directory: apps/codecov-api
41+
42+
api-mypy:
43+
name: Patch typing (API)
44+
uses: codecov/gha-workflows/.github/workflows/mypy.yml@pr41
45+
with:
46+
working_directory: apps/codecov-api
47+
48+
api-build:
49+
name: Build App (API)
50+
uses: codecov/gha-workflows/.github/workflows/build-app.yml@pr41
51+
secrets: inherit
52+
with:
53+
repo: ${{ vars.CODECOV_API_IMAGE_V2 || 'codecov/self-hosted-api' }}
54+
working_directory: apps/codecov-api
55+
56+
api-codecovstartup:
57+
name: Codecov Startup (API)
58+
needs: api-build
59+
uses: codecov/gha-workflows/.github/workflows/codecov-startup.yml@pr41
60+
secrets: inherit
61+
with:
62+
working_directory: apps/codecov-api
63+
64+
api-test:
65+
name: Test (API)
66+
needs: [api-build]
67+
uses: codecov/gha-workflows/.github/workflows/run-tests.yml@pr41
68+
secrets: inherit
69+
with:
70+
repo: ${{ vars.CODECOV_API_IMAGE_V2 || 'codecov/self-hosted-api' }}
71+
working_directory: apps/codecov-api
72+
73+
api-build-self-hosted:
74+
name: Build Self Hosted (API)
75+
needs: [api-build, api-test]
76+
uses: codecov/gha-workflows/.github/workflows/self-hosted.yml@pr41
77+
secrets: inherit
78+
with:
79+
repo: ${{ vars.CODECOV_API_IMAGE_V2 || 'codecov/self-hosted-api' }}
80+
working_directory: apps/codecov-api
81+
82+
api-staging:
83+
name: Push Staging Image (API)
84+
needs: [api-build, api-test]
85+
if: ${{ github.event_name == 'push' && (github.event.ref == 'refs/heads/main' || github.event.ref == 'refs/heads/staging') && github.repository_owner == 'codecov' }}
86+
uses: codecov/gha-workflows/.github/workflows/push-env.yml@pr41
87+
secrets: inherit
88+
with:
89+
environment: staging
90+
repo: ${{ vars.CODECOV_API_IMAGE_V2 || 'codecov/self-hosted-api' }}
91+
working_directory: apps/codecov-api
92+
sentry_project: api
93+
94+
api-production:
95+
name: Push Production Image (API)
96+
needs: [api-build, api-test]
97+
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' && github.repository_owner == 'codecov' }}
98+
uses: codecov/gha-workflows/.github/workflows/push-env.yml@pr41
99+
secrets: inherit
100+
with:
101+
environment: production
102+
repo: ${{ vars.CODECOV_API_IMAGE_V2 || 'codecov/self-hosted-api' }}
103+
working_directory: apps/codecov-api
104+
sentry_project: api
105+
106+
api-self-hosted:
107+
name: Push Self Hosted Image (API)
108+
needs: [api-build-self-hosted, api-test]
109+
secrets: inherit
110+
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' && github.repository_owner == 'codecov' }}
111+
uses: codecov/gha-workflows/.github/workflows/self-hosted.yml@pr41
112+
with:
113+
push_rolling: true
114+
repo: ${{ vars.CODECOV_API_IMAGE_V2 || 'codecov/self-hosted-api' }}
115+
working_directory: apps/codecov-api

0 commit comments

Comments
 (0)