Skip to content

Commit bc39577

Browse files
committed
add API CI
1 parent 2ca0465 commit bc39577

File tree

1 file changed

+118
-0
lines changed

1 file changed

+118
-0
lines changed

.github/workflows/api-ci.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
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/[email protected]
39+
with:
40+
working_directory: apps/codecov-api
41+
42+
api-mypy:
43+
name: Patch typing (API)
44+
uses: codecov/gha-workflows/.github/workflows/[email protected]
45+
with:
46+
working_directory: apps/codecov-api
47+
48+
api-build:
49+
name: Build App (API)
50+
uses: codecov/gha-workflows/.github/workflows/[email protected]
51+
secrets: inherit
52+
with:
53+
repo: ${{ vars.CODECOV_API_IMAGE_V2 || 'codecov/self-hosted-api' }}
54+
working_directory: apps/codecov-api
55+
56+
# Runs create-commit, create-report
57+
api-codecovstartup:
58+
name: Codecov Startup (API)
59+
needs: api-build
60+
uses: codecov/gha-workflows/.github/workflows/[email protected]
61+
secrets: inherit
62+
with:
63+
working_directory: apps/codecov-api
64+
65+
api-test:
66+
name: Test (API)
67+
needs: [api-build, api-codecovstartup]
68+
uses: codecov/gha-workflows/.github/workflows/[email protected]
69+
secrets: inherit
70+
with:
71+
run_integration: false
72+
repo: ${{ vars.CODECOV_API_IMAGE_V2 || 'codecov/self-hosted-api' }}
73+
working_directory: apps/codecov-api
74+
flag_prefix: api
75+
76+
api-build-self-hosted:
77+
name: Build Self Hosted (API)
78+
needs: [api-build, api-test]
79+
uses: codecov/gha-workflows/.github/workflows/[email protected]
80+
secrets: inherit
81+
with:
82+
repo: ${{ vars.CODECOV_API_IMAGE_V2 || 'codecov/self-hosted-api' }}
83+
working_directory: apps/codecov-api
84+
85+
api-staging:
86+
name: Push Staging Image (API)
87+
needs: [api-build, api-test]
88+
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/staging' && github.repository_owner == 'codecov' }}
89+
uses: codecov/gha-workflows/.github/workflows/[email protected]
90+
secrets: inherit
91+
with:
92+
environment: staging
93+
repo: ${{ vars.CODECOV_API_IMAGE_V2 || 'codecov/self-hosted-api' }}
94+
working_directory: apps/codecov-api
95+
sentry_project: api
96+
97+
api-production:
98+
name: Push Production Image (API)
99+
needs: [api-build, api-test]
100+
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' && github.repository_owner == 'codecov' }}
101+
uses: codecov/gha-workflows/.github/workflows/[email protected]
102+
secrets: inherit
103+
with:
104+
environment: production
105+
repo: ${{ vars.CODECOV_API_IMAGE_V2 || 'codecov/self-hosted-api' }}
106+
working_directory: apps/codecov-api
107+
sentry_project: api
108+
109+
api-self-hosted:
110+
name: Push Self Hosted Image (API)
111+
needs: [api-build-self-hosted, api-test]
112+
secrets: inherit
113+
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' && github.repository_owner == 'codecov' }}
114+
uses: codecov/gha-workflows/.github/workflows/[email protected]
115+
with:
116+
push_rolling: true
117+
repo: ${{ vars.CODECOV_API_IMAGE_V2 || 'codecov/self-hosted-api' }}
118+
working_directory: apps/codecov-api

0 commit comments

Comments
 (0)