Skip to content

Commit 2cbc394

Browse files
committed
add API CI
1 parent 10148ef commit 2cbc394

File tree

1 file changed

+116
-0
lines changed

1 file changed

+116
-0
lines changed

.github/workflows/api-ci.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
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-split.yml@pr41
68+
secrets: inherit
69+
with:
70+
run_integration: false
71+
repo: ${{ vars.CODECOV_API_IMAGE_V2 || 'codecov/self-hosted-api' }}
72+
working_directory: apps/codecov-api
73+
74+
api-build-self-hosted:
75+
name: Build Self Hosted (API)
76+
needs: [api-build, api-test]
77+
uses: codecov/gha-workflows/.github/workflows/self-hosted.yml@pr41
78+
secrets: inherit
79+
with:
80+
repo: ${{ vars.CODECOV_API_IMAGE_V2 || 'codecov/self-hosted-api' }}
81+
working_directory: apps/codecov-api
82+
83+
api-staging:
84+
name: Push Staging Image (API)
85+
needs: [api-build, api-test]
86+
if: ${{ github.event_name == 'push' && (github.event.ref == 'refs/heads/main' || github.event.ref == 'refs/heads/staging') && github.repository_owner == 'codecov' }}
87+
uses: codecov/gha-workflows/.github/workflows/push-env.yml@pr41
88+
secrets: inherit
89+
with:
90+
environment: staging
91+
repo: ${{ vars.CODECOV_API_IMAGE_V2 || 'codecov/self-hosted-api' }}
92+
working_directory: apps/codecov-api
93+
sentry_project: api
94+
95+
api-production:
96+
name: Push Production Image (API)
97+
needs: [api-build, api-test]
98+
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' && github.repository_owner == 'codecov' }}
99+
uses: codecov/gha-workflows/.github/workflows/push-env.yml@pr41
100+
secrets: inherit
101+
with:
102+
environment: production
103+
repo: ${{ vars.CODECOV_API_IMAGE_V2 || 'codecov/self-hosted-api' }}
104+
working_directory: apps/codecov-api
105+
sentry_project: api
106+
107+
api-self-hosted:
108+
name: Push Self Hosted Image (API)
109+
needs: [api-build-self-hosted, api-test]
110+
secrets: inherit
111+
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' && github.repository_owner == 'codecov' }}
112+
uses: codecov/gha-workflows/.github/workflows/self-hosted.yml@pr41
113+
with:
114+
push_rolling: true
115+
repo: ${{ vars.CODECOV_API_IMAGE_V2 || 'codecov/self-hosted-api' }}
116+
working_directory: apps/codecov-api

0 commit comments

Comments
 (0)