Skip to content

Commit 759ab6b

Browse files
committed
fix: split codecov yaml and upload in release flow
1 parent acee860 commit 759ab6b

2 files changed

Lines changed: 36 additions & 23 deletions

File tree

.github/workflows/release.yml

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ jobs:
7070
--output-style=stream \
7171
--logger "console;verbosity=minimal"
7272
73+
- name: Sync Codecov flags
74+
run: pnpm nx run tests:coverage:sync
75+
7376
- name: Configure Git
7477
run: |
7578
git config user.name "github-actions[bot]"
@@ -191,27 +194,6 @@ jobs:
191194
# gh release edit "${VERSION}" --notes-file /tmp/combined-notes.md
192195
# fi
193196

194-
- name: Install Codecov CLI
195-
if: always()
196-
run: |
197-
curl https://keybase.io/codecovsecurity/pgp_keys.asc \
198-
| gpg --no-default-keyring --keyring trustedkeys.gpg --import
199-
curl -Os https://cli.codecov.io/latest/linux/codecov
200-
curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM
201-
curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM.sig
202-
gpg --no-default-keyring --keyring trustedkeys.gpg \
203-
--verify codecov.SHA256SUM.sig codecov.SHA256SUM
204-
shasum -a 256 -c codecov.SHA256SUM
205-
sudo chmod +x codecov
206-
sudo mv codecov /usr/local/bin/codecov
207-
208-
- name: Upload coverage to Codecov
209-
if: always()
210-
continue-on-error: true
211-
env:
212-
CODECOV_TOKEN: ${{ secrets.FLOWTHRU_CODECOV_TOKEN }}
213-
run: pnpm nx run tests:coverage:upload
214-
215197
- name: Publish preview to NuGet
216198
if: steps.release.outputs.changed == 'true'
217199
env:
@@ -233,3 +215,24 @@ jobs:
233215
--api-key "${FLOWTHRU_NUGET_API_KEY}" \
234216
--source https://api.nuget.org/v3/index.json \
235217
--skip-duplicate
218+
219+
- name: Install Codecov CLI
220+
if: always()
221+
run: |
222+
curl https://keybase.io/codecovsecurity/pgp_keys.asc \
223+
| gpg --no-default-keyring --keyring trustedkeys.gpg --import
224+
curl -Os https://cli.codecov.io/latest/linux/codecov
225+
curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM
226+
curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM.sig
227+
gpg --no-default-keyring --keyring trustedkeys.gpg \
228+
--verify codecov.SHA256SUM.sig codecov.SHA256SUM
229+
shasum -a 256 -c codecov.SHA256SUM
230+
sudo chmod +x codecov
231+
sudo mv codecov /usr/local/bin/codecov
232+
233+
- name: Upload coverage to Codecov
234+
if: always()
235+
continue-on-error: true
236+
env:
237+
CODECOV_TOKEN: ${{ secrets.FLOWTHRU_CODECOV_TOKEN }}
238+
run: pnpm nx run tests:coverage:upload

tests/project.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,22 @@
4040
"parallel": false
4141
}
4242
},
43+
"coverage:sync": {
44+
"//": "Sync codecov.yml flags and components from the current project graph and stage the file for commit. Must run before the release commit so the updated codecov.yml is included.",
45+
"executor": "nx:run-commands",
46+
"options": {
47+
"commands": [
48+
"node scripts/sync-codecov-flags.mjs"
49+
],
50+
"cwd": "{workspaceRoot}",
51+
"parallel": false
52+
}
53+
},
4354
"coverage:upload": {
44-
"//": "Sync Codecov flags from the current project graph, then upload all coverage.cobertura.xml files found under tests/. Assumes tests have already been run. Requires CODECOV_TOKEN env var and the codecov CLI on PATH.",
55+
"//": "Upload all coverage.cobertura.xml files found under tests/ to Codecov. Assumes tests have already been run and coverage:sync has been called. Requires CODECOV_TOKEN env var and the codecov CLI on PATH.",
4556
"executor": "nx:run-commands",
4657
"options": {
4758
"commands": [
48-
"node scripts/sync-codecov-flags.mjs",
4959
"bash scripts/upload-coverage.sh"
5060
],
5161
"cwd": "{workspaceRoot}",

0 commit comments

Comments
 (0)