From df5300f245b82e6efc15f616724874fbbb0b8a2d Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Tue, 12 Mar 2024 15:50:33 +0100 Subject: [PATCH] enable relative-CI (#1265) Co-authored-by: Jerel Miller --- .changeset/old-bears-breathe.md | 5 +++++ .github/workflows/build-pr.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/relative-ci.yaml | 17 +++++++++++++++++ .gitignore | 3 ++- 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .changeset/old-bears-breathe.md create mode 100644 .github/workflows/build-pr.yml create mode 100644 .github/workflows/relative-ci.yaml diff --git a/.changeset/old-bears-breathe.md b/.changeset/old-bears-breathe.md new file mode 100644 index 000000000..3a86d154e --- /dev/null +++ b/.changeset/old-bears-breathe.md @@ -0,0 +1,5 @@ +--- +"apollo-client-devtools": patch +--- + +Use relative-CI to monitor build artefact sizes diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml new file mode 100644 index 000000000..0218d01ae --- /dev/null +++ b/.github/workflows/build-pr.yml @@ -0,0 +1,28 @@ +name: Build + +on: + push: + branches: + - main + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: "18.x" + + # Install dependencies + - run: npm ci + + # Build and output bunle stats to webpack-stats.json + - run: yarn build --env TARGET=chrome --json webpack-stats.json + + # Upload webpack-stats.json to use on relative-ci.yaml workflow + - name: Upload webpack stats artifact + uses: relative-ci/agent-upload-artifact-action@v1 + with: + webpackStatsFile: ./webpack-stats.json diff --git a/.github/workflows/relative-ci.yaml b/.github/workflows/relative-ci.yaml new file mode 100644 index 000000000..92600e4de --- /dev/null +++ b/.github/workflows/relative-ci.yaml @@ -0,0 +1,17 @@ +name: RelativeCI + +on: + workflow_run: + workflows: ["Build"] + types: + - completed + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Send bundle stats and build information to RelativeCI + uses: relative-ci/agent-action@v2 + with: + key: ${{ secrets.RELATIVE_CI_KEY }} + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index ab855770f..4214b6f86 100755 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ build !./dist/.gitkeep *.zip .DS_Store -development/server/db.json \ No newline at end of file +development/server/db.json +webpack-stats.json \ No newline at end of file