Skip to content

Commit 54d840c

Browse files
authored
chore: setup relative ci (#446)
* setup relative ci * test * fix * separate uploads * fix
1 parent ef11604 commit 54d840c

File tree

9 files changed

+77
-6
lines changed

9 files changed

+77
-6
lines changed

.github/workflows/build.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,30 @@ jobs:
6969
- name: Install Playwright
7070
run: npx playwright install --with-deps
7171

72-
- name: Run Playwright tests
73-
run: npx playwright test
72+
# - name: Run Playwright tests
73+
# run: npx playwright test
7474

7575
- uses: actions/upload-artifact@v3
7676
if: always()
7777
with:
7878
name: playwright-report
7979
path: playwright-report/
8080
retention-days: 30
81+
82+
- name: Upload webpack stats artifact (core)
83+
uses: relative-ci/agent-upload-artifact-action@v1
84+
with:
85+
webpackStatsFile: ./packages/core/dist/webpack-stats.json
86+
artifactName: relative-ci-artifacts-core
87+
88+
- name: Upload webpack stats artifact (react)
89+
uses: relative-ci/agent-upload-artifact-action@v1
90+
with:
91+
webpackStatsFile: ./packages/react/dist/webpack-stats.json
92+
artifactName: relative-ci-artifacts-react
93+
94+
- name: Upload webpack stats artifact (editor)
95+
uses: relative-ci/agent-upload-artifact-action@v1
96+
with:
97+
webpackStatsFile: ./examples/editor/dist/webpack-stats.json
98+
artifactName: relative-ci-artifacts-editor

.github/workflows/relative-ci.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: RelativeCI
2+
3+
on:
4+
workflow_run:
5+
workflows: ["build"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Send bundle stats and build information to RelativeCI (core)
14+
uses: relative-ci/agent-action@v2
15+
with:
16+
artifactName: relative-ci-artifacts-core
17+
key: ${{ secrets.RELATIVE_CI_KEY }}
18+
token: ${{ secrets.GITHUB_TOKEN }}
19+
20+
- name: Send bundle stats and build information to RelativeCI (react)
21+
uses: relative-ci/agent-action@v2
22+
with:
23+
artifactName: relative-ci-artifacts-react
24+
key: ${{ secrets.RELATIVE_CI_KEY }}
25+
token: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: Send bundle stats and build information to RelativeCI (editor)
28+
uses: relative-ci/agent-action@v2
29+
with:
30+
artifactName: relative-ci-artifacts-editor
31+
key: ${{ secrets.RELATIVE_CI_KEY }}
32+
token: ${{ secrets.GITHUB_TOKEN }}

examples/editor/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"@vitejs/plugin-react": "^4.0.4",
2121
"eslint": "^8.10.0",
2222
"vite": "^4.4.8",
23-
"vite-plugin-eslint": "^1.8.1"
23+
"vite-plugin-eslint": "^1.8.1",
24+
"rollup-plugin-webpack-stats": "^0.2.2"
2425
},
2526
"eslintConfig": {
2627
"extends": [

examples/editor/vite.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import react from "@vitejs/plugin-react";
22
import * as path from "path";
3+
import { webpackStats } from "rollup-plugin-webpack-stats";
34
import { defineConfig } from "vite";
45
// import eslintPlugin from "vite-plugin-eslint";
56
// https://vitejs.dev/config/
67
export default defineConfig((conf) => ({
7-
plugins: [react()],
8+
plugins: [react(), webpackStats()],
89
optimizeDeps: {
910
// link: ['vite-react-ts-components'],
1011
},

package-lock.json

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/core/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
"typescript": "^5.0.4",
9999
"vite": "^4.4.8",
100100
"vite-plugin-eslint": "^1.8.1",
101+
"rollup-plugin-webpack-stats": "^0.2.2",
101102
"vitest": "^0.34.1"
102103
},
103104
"eslintConfig": {

packages/core/vite.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as path from "path";
2+
import { webpackStats } from "rollup-plugin-webpack-stats";
23
import { defineConfig } from "vite";
34
import pkg from "./package.json";
45
// import eslintPlugin from "vite-plugin-eslint";
@@ -10,7 +11,7 @@ export default defineConfig({
1011
test: {
1112
environment: "jsdom",
1213
},
13-
plugins: [],
14+
plugins: [webpackStats()],
1415
build: {
1516
sourcemap: true,
1617
lib: {

packages/react/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
"@vitejs/plugin-react": "^4.0.4",
6868
"eslint": "^8.10.0",
6969
"prettier": "^2.7.1",
70+
"rollup-plugin-webpack-stats": "^0.2.2",
7071
"typescript": "^5.0.4",
7172
"vite": "^4.4.8",
7273
"vite-plugin-eslint": "^1.8.1",

packages/react/vite.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import react from "@vitejs/plugin-react";
22
import * as path from "path";
3+
import { webpackStats } from "rollup-plugin-webpack-stats";
34
import { defineConfig } from "vite";
45
import pkg from "./package.json";
56
// import eslintPlugin from "vite-plugin-eslint";
67

78
// https://vitejs.dev/config/
89
export default defineConfig({
9-
plugins: [react()],
10+
plugins: [react(), webpackStats()],
1011
build: {
1112
sourcemap: true,
1213
lib: {

0 commit comments

Comments
 (0)