From f6453fe1950aab502dfce423cd3cd176427fd524 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Mon, 7 Oct 2024 13:20:14 +0200 Subject: [PATCH 1/8] Enable codecov bundle analysis --- .github/workflows/coverage.yaml | 4 + frontend/package-lock.json | 383 ++++++++++++++++++++++++++++++++ frontend/package.json | 1 + frontend/vite.config.ts | 10 + 4 files changed, 398 insertions(+) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 1709a30b6..0d5157c84 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -62,6 +62,10 @@ jobs: working-directory: ./frontend run: npm ci + - name: Build the frontend + working-directory: ./frontend + run: npm run build + - name: Test working-directory: ./frontend run: npm run coverage diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 4ac6a4e86..e77da9705 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -39,6 +39,7 @@ "@browser-logos/chrome": "^2.0.0", "@browser-logos/firefox": "^3.0.10", "@browser-logos/safari": "^2.1.0", + "@codecov/vite-plugin": "^1.2.0", "@graphql-codegen/add": "^5.0.3", "@graphql-codegen/cli": "^5.0.2", "@graphql-codegen/client-preset": "^4.3.3", @@ -106,6 +107,71 @@ "node": ">=0.10.0" } }, + "node_modules/@actions/core": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz", + "integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@actions/exec": "^1.1.1", + "@actions/http-client": "^2.0.1" + } + }, + "node_modules/@actions/exec": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz", + "integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@actions/io": "^1.0.1" + } + }, + "node_modules/@actions/github": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@actions/github/-/github-6.0.0.tgz", + "integrity": "sha512-alScpSVnYmjNEXboZjarjukQEzgCRmjMv6Xj47fsdnqGS73bjJNDpiiXmp8jr0UZLdUB6d9jW63IcmddUP+l0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@actions/http-client": "^2.2.0", + "@octokit/core": "^5.0.1", + "@octokit/plugin-paginate-rest": "^9.0.0", + "@octokit/plugin-rest-endpoint-methods": "^10.0.0" + } + }, + "node_modules/@actions/http-client": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.3.tgz", + "integrity": "sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tunnel": "^0.0.6", + "undici": "^5.25.4" + } + }, + "node_modules/@actions/http-client/node_modules/undici": { + "version": "5.28.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", + "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + }, + "node_modules/@actions/io": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz", + "integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==", + "dev": true, + "license": "MIT" + }, "node_modules/@alloc/quick-lru": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", @@ -2460,6 +2526,110 @@ "integrity": "sha512-diidPiK62E4hlAh0dyLfWQDZXi2SSAGiOuw6iqD1x8ztw7L/Sz3He46FhcxEzYa1hKi1blCkjnKDjqw6rQfgcA==", "dev": true }, + "node_modules/@codecov/bundler-plugin-core": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@codecov/bundler-plugin-core/-/bundler-plugin-core-1.2.0.tgz", + "integrity": "sha512-ublUP5V0tW6oDnaJ1UBWvEmVAkvMmPNEwWkpF+WwJSCBWNLvWrkSwG84S3Gt5Xbnh17xEyAxXBmNzF+mXVXBgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@actions/core": "^1.10.1", + "@actions/github": "^6.0.0", + "chalk": "4.1.2", + "semver": "^7.5.4", + "unplugin": "^1.10.1", + "zod": "^3.22.4" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@codecov/bundler-plugin-core/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@codecov/bundler-plugin-core/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@codecov/bundler-plugin-core/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@codecov/bundler-plugin-core/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@codecov/bundler-plugin-core/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@codecov/vite-plugin": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@codecov/vite-plugin/-/vite-plugin-1.2.0.tgz", + "integrity": "sha512-hX3VDomMYRNWDgLTRu7mzGn902ei6tiKa3S9qDrwQwVHdsBw22J47towlpxf3g92QWMOKrkWgEpQrU50h9PWzg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codecov/bundler-plugin-core": "^1.2.0", + "unplugin": "^1.10.1" + }, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "vite": "4.x || 5.x" + } + }, "node_modules/@csstools/selector-resolve-nested": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@csstools/selector-resolve-nested/-/selector-resolve-nested-2.0.0.tgz", @@ -3005,6 +3175,16 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@fastify/busboy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, "node_modules/@floating-ui/core": { "version": "1.6.8", "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.8.tgz", @@ -4984,6 +5164,178 @@ "node": ">= 8" } }, + "node_modules/@octokit/auth-token": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz", + "integrity": "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/core": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.2.0.tgz", + "integrity": "sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/auth-token": "^4.0.0", + "@octokit/graphql": "^7.1.0", + "@octokit/request": "^8.3.1", + "@octokit/request-error": "^5.1.0", + "@octokit/types": "^13.0.0", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/endpoint": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.5.tgz", + "integrity": "sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^13.1.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/graphql": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.1.0.tgz", + "integrity": "sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/request": "^8.3.0", + "@octokit/types": "^13.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/openapi-types": { + "version": "22.2.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.2.0.tgz", + "integrity": "sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@octokit/plugin-paginate-rest": { + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-9.2.1.tgz", + "integrity": "sha512-wfGhE/TAkXZRLjksFXuDZdmGnJQHvtU/joFQdweXUgzo1XwvBCD4o4+75NtFfjfLK5IwLf9vHTfSiU3sLRYpRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^12.6.0" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "@octokit/core": "5" + } + }, + "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/openapi-types": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-20.0.0.tgz", + "integrity": "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": { + "version": "12.6.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.6.0.tgz", + "integrity": "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^20.0.0" + } + }, + "node_modules/@octokit/plugin-rest-endpoint-methods": { + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-10.4.1.tgz", + "integrity": "sha512-xV1b+ceKV9KytQe3zCVqjg+8GTGfDYwaT1ATU5isiUyVtlVAO3HNdzpS4sr4GBx4hxQ46s7ITtZrAsxG22+rVg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^12.6.0" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "@octokit/core": "5" + } + }, + "node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/openapi-types": { + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-20.0.0.tgz", + "integrity": "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": { + "version": "12.6.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.6.0.tgz", + "integrity": "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^20.0.0" + } + }, + "node_modules/@octokit/request": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.4.0.tgz", + "integrity": "sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/endpoint": "^9.0.1", + "@octokit/request-error": "^5.1.0", + "@octokit/types": "^13.1.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/request-error": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.1.0.tgz", + "integrity": "sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^13.1.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/types": { + "version": "13.6.1", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.6.1.tgz", + "integrity": "sha512-PHZE9Z+kWXb23Ndik8MKPirBPziOc0D2/3KH1P+6jK5nGWe96kadZuE4jev2/Jq7FvIfTlT2Ltg8Fv2x1v0a5g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^22.2.0" + } + }, "node_modules/@peculiar/asn1-schema": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/@peculiar/asn1-schema/-/asn1-schema-2.3.8.tgz", @@ -9934,6 +10286,13 @@ } ] }, + "node_modules/before-after-hook": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", + "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/better-opn": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/better-opn/-/better-opn-3.0.2.tgz", @@ -11222,6 +11581,13 @@ "node": ">= 0.6.0" } }, + "node_modules/deprecation": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", + "dev": true, + "license": "ISC" + }, "node_modules/dequal": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", @@ -20768,6 +21134,16 @@ "fsevents": "~2.3.3" } }, + "node_modules/tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.6.11 <=0.7.0 || >=0.7.3" + } + }, "node_modules/tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -21062,6 +21438,13 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/universal-user-agent": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz", + "integrity": "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==", + "dev": true, + "license": "ISC" + }, "node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", diff --git a/frontend/package.json b/frontend/package.json index 5f99112cb..76bd08d3f 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -48,6 +48,7 @@ "@browser-logos/chrome": "^2.0.0", "@browser-logos/firefox": "^3.0.10", "@browser-logos/safari": "^2.1.0", + "@codecov/vite-plugin": "^1.2.0", "@graphql-codegen/add": "^5.0.3", "@graphql-codegen/cli": "^5.0.2", "@graphql-codegen/client-preset": "^4.3.3", diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 48a799190..08f9eb921 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -7,6 +7,7 @@ import { readFile, writeFile } from "fs/promises"; import { resolve } from "path"; +import { codecovVitePlugin } from "@codecov/vite-plugin"; import { TanStackRouterVite as tanStackRouter } from "@tanstack/router-vite-plugin"; import react from "@vitejs/plugin-react"; import browserslistToEsbuild from "browserslist-to-esbuild"; @@ -69,6 +70,15 @@ export default defineConfig((env) => ({ tanStackRouter(), + codecovVitePlugin({ + enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined, + bundleName: "mas-frontend", + gitService: "github", + oidc: { + useGitHubOIDC: true, + }, + }), + // Custom plugin to make sure that each asset has an entry in the manifest // This is needed so that the preloading & asset integrity generation works { From 0536ad568adab3252e2eb554a3203cfc3cba7a16 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Mon, 7 Oct 2024 13:27:25 +0200 Subject: [PATCH 2/8] Tweak CI --- .github/workflows/coverage.yaml | 7 +++++-- frontend/vite.config.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 0d5157c84..0abef2426 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -47,6 +47,7 @@ jobs: runs-on: ubuntu-latest permissions: + id-token: write contents: read steps: @@ -56,7 +57,7 @@ jobs: - name: Install Node uses: actions/setup-node@v4.0.4 with: - node-version: 18 + node-version: 20 - name: Install Node dependencies working-directory: ./frontend @@ -69,6 +70,8 @@ jobs: - name: Test working-directory: ./frontend run: npm run coverage + env: + UPLOAD_CODECOV_BUNDLE: true - name: Upload to codecov.io uses: codecov/codecov-action@v4.6.0 @@ -116,7 +119,7 @@ jobs: - name: Install Node uses: actions/setup-node@v4.0.4 with: - node-version: 18 + node-version: 20 - name: Install Node dependencies working-directory: ./frontend diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 08f9eb921..d4c09f4d2 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -71,7 +71,7 @@ export default defineConfig((env) => ({ tanStackRouter(), codecovVitePlugin({ - enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined, + enableBundleAnalysis: process.env.UPLOAD_CODECOV_BUNDLE === "true", bundleName: "mas-frontend", gitService: "github", oidc: { From 813efa063a04ea33cbfb16549a7f1ef9057c8703 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Mon, 7 Oct 2024 13:43:22 +0200 Subject: [PATCH 3/8] Use the CODECOV_TOKEN --- frontend/vite.config.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index d4c09f4d2..030833585 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -72,11 +72,9 @@ export default defineConfig((env) => ({ codecovVitePlugin({ enableBundleAnalysis: process.env.UPLOAD_CODECOV_BUNDLE === "true", + uploadToken: process.env.CODECOV_TOKEN, bundleName: "mas-frontend", gitService: "github", - oidc: { - useGitHubOIDC: true, - }, }), // Custom plugin to make sure that each asset has an entry in the manifest From e0bfb73698a02828aab6e2e34de212dd8264ea9c Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Mon, 7 Oct 2024 13:46:15 +0200 Subject: [PATCH 4/8] Enable codecov plugin debug mode --- frontend/vite.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 030833585..ff9c93c75 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -71,6 +71,7 @@ export default defineConfig((env) => ({ tanStackRouter(), codecovVitePlugin({ + debug: true, enableBundleAnalysis: process.env.UPLOAD_CODECOV_BUNDLE === "true", uploadToken: process.env.CODECOV_TOKEN, bundleName: "mas-frontend", From ee59a2f0e21e7ff83c5777383022f68ff5955eaf Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Mon, 7 Oct 2024 13:51:22 +0200 Subject: [PATCH 5/8] =?UTF-8?q?oooh,=20YAML=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/coverage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 0abef2426..c96016eb5 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -71,7 +71,7 @@ jobs: working-directory: ./frontend run: npm run coverage env: - UPLOAD_CODECOV_BUNDLE: true + UPLOAD_CODECOV_BUNDLE: "true" - name: Upload to codecov.io uses: codecov/codecov-action@v4.6.0 From 30286f80f4567f176f0c60b9983553a4e009a76d Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Mon, 7 Oct 2024 14:46:52 +0200 Subject: [PATCH 6/8] Set the environment variable for the right step --- .github/workflows/coverage.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index c96016eb5..85e44ef18 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -66,12 +66,12 @@ jobs: - name: Build the frontend working-directory: ./frontend run: npm run build + env: + UPLOAD_CODECOV_BUNDLE: "true" - name: Test working-directory: ./frontend run: npm run coverage - env: - UPLOAD_CODECOV_BUNDLE: "true" - name: Upload to codecov.io uses: codecov/codecov-action@v4.6.0 From 9f57de79e6c3a43ebe53c46ccfb41bbf81d31567 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Mon, 7 Oct 2024 14:49:08 +0200 Subject: [PATCH 7/8] Use GH OIDC for bundle analysis upload --- frontend/vite.config.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index ff9c93c75..11d2134aa 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -73,9 +73,11 @@ export default defineConfig((env) => ({ codecovVitePlugin({ debug: true, enableBundleAnalysis: process.env.UPLOAD_CODECOV_BUNDLE === "true", - uploadToken: process.env.CODECOV_TOKEN, bundleName: "mas-frontend", gitService: "github", + oidc: { + useGitHubOIDC: true, + }, }), // Custom plugin to make sure that each asset has an entry in the manifest From 7ca6458f3f501b36130c9db87312c4cbbdb70470 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Mon, 7 Oct 2024 14:54:36 +0200 Subject: [PATCH 8/8] Remove codecov debug flag --- frontend/vite.config.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 11d2134aa..d4c09f4d2 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -71,7 +71,6 @@ export default defineConfig((env) => ({ tanStackRouter(), codecovVitePlugin({ - debug: true, enableBundleAnalysis: process.env.UPLOAD_CODECOV_BUNDLE === "true", bundleName: "mas-frontend", gitService: "github",