Skip to content

Commit ac3d6a4

Browse files
committed
add shared CI workflow
1 parent c8d858c commit ac3d6a4

File tree

2 files changed

+147
-9
lines changed

2 files changed

+147
-9
lines changed

.github/workflows/shared-ci.yml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
name: Shared CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'libs/shared/**'
9+
- 'libs/shared'
10+
pull_request:
11+
paths:
12+
- 'libs/shared/**'
13+
- 'libs/shared'
14+
merge_group:
15+
paths:
16+
- 'libs/shared/**'
17+
- 'libs/shared'
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
21+
cancel-in-progress: true
22+
23+
jobs:
24+
# TODO: get mypy running
25+
shared-lint:
26+
name: Run Lint (Shared)
27+
uses: codecov/gha-workflows/.github/workflows/[email protected]
28+
with:
29+
working_directory: libs/shared
30+
31+
shared-codecovstartup:
32+
name: Codecov Startup (Shared)
33+
uses: codecov/gha-workflows/.github/workflows/[email protected]
34+
secrets: inherit
35+
with:
36+
working_directory: libs/shared
37+
38+
shared-test:
39+
name: Test (Shared)
40+
runs-on: ubuntu-latest
41+
defaults:
42+
run:
43+
working-directory: libs/shared
44+
steps:
45+
- name: Checkout
46+
uses: actions/checkout@v4
47+
with:
48+
submodules: 'recursive'
49+
50+
- name: Build test environment
51+
run: |
52+
make test_env.build
53+
54+
- name: Bring containers up
55+
run: |
56+
make test_env.up
57+
58+
- name: Run tests
59+
run: |
60+
make test_env.test
61+
62+
- uses: actions/upload-artifact@v4
63+
if: ${{ !cancelled() }}
64+
with:
65+
name: coveragefiles
66+
path: libs/shared/tests/*.coverage.xml
67+
68+
- uses: actions/upload-artifact@v4
69+
if: ${{ !cancelled() }}
70+
with:
71+
name: junitfiles
72+
path: libs/shared/tests/*junit*.xml
73+
74+
shared-upload-to-codecov:
75+
name: Upload to Codecov (shared)
76+
needs: [shared-test]
77+
runs-on: ubuntu-latest
78+
strategy:
79+
matrix:
80+
include:
81+
- codecov_url_secret: CODECOV_URL
82+
codecov_token_secret: CODECOV_ORG_TOKEN
83+
name: prod
84+
- codecov_url_secret: CODECOV_STAGING_URL
85+
codecov_token_secret: CODECOV_ORG_TOKEN_STAGING
86+
name: staging
87+
- codecov_url_secret: CODECOV_QA_URL
88+
codecov_token_secret: CODECOV_QA_ORG
89+
name: qa
90+
- codecov_url_secret: CODECOV_PUBLIC_QA_URL
91+
codecov_token_secret: CODECOV_PUBLIC_QA_TOKEN
92+
name: public qa
93+
94+
steps:
95+
- name: Checkout
96+
uses: actions/checkout@v4
97+
with:
98+
fetch-depth: 0
99+
submodules: 'recursive'
100+
101+
- name: Download coverage
102+
id: download_coverage
103+
uses: actions/download-artifact@v4
104+
with:
105+
name: coveragefiles
106+
107+
- name: Download test results
108+
id: download_test_results
109+
uses: actions/download-artifact@v4
110+
with:
111+
name: junitfiles
112+
113+
- name: Uploading unit test coverage (${{ matrix.name }})
114+
uses: codecov/codecov-action@v5
115+
with:
116+
files: ${{ steps.download_coverage.outputs.download-path }}/unit.coverage.xml
117+
flags: shared-docker-uploader
118+
disable_search: true
119+
# Strange workaround: API has a `codecov` directory in the repo root
120+
# which conflicts with the action's `codecov` binary
121+
use_pypi: true
122+
token: ${{ secrets[matrix.codecov_token_secret] }}
123+
url: ${{ secrets[matrix.codecov_url_secret] }}
124+
working-directory: libs/shared
125+
126+
- name: Uploading unit test results (${{ matrix.name }})
127+
uses: codecov/test-results-action@v1
128+
with:
129+
files: ${{ steps.download_test_results.outputs.download-path }}/unit.junit.xml
130+
flags: shared-docker-uploader
131+
disable_search: true
132+
token: ${{ secrets[matrix.codecov_token_secret] }}
133+
url: ${{ secrets[matrix.codecov_url_secret] }}
134+
# The coverage action will have installed codecovcli with pip. The
135+
# actual binary will be found in $PATH.
136+
binary: codecovcli
137+
working-directory: libs/shared
138+

codecov.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
ignore:
22
- "**tests**/test_*.py"
3-
comment:
4-
show_critical_paths: true
5-
6-
beta_groups:
7-
- "labels"
83

94
flag_management:
10-
individual_flags:
11-
- name: "smart-labels"
12-
carryforward: true
13-
carryforward_mode: "labels"
5+
default_rules:
6+
carryforward: true
7+
statuses:
8+
- type: project
9+
target: auto
10+
threshold: 1
11+
- type: patch
12+
target: 90
1413

1514
codecov:
15+
wait_for_ci: false
1616
require_ci_to_pass: false

0 commit comments

Comments
 (0)