From 9ecba9a6f1a3efbd6b5ad3321268d16be1f3a7e8 Mon Sep 17 00:00:00 2001 From: adilallo <39313955+adilallo@users.noreply.github.com> Date: Fri, 29 Aug 2025 20:42:57 -0600 Subject: [PATCH 1/7] Fix runner issues: Correct labels, fix YAML indentation, add canary job --- .gitea/workflows/ci.yaml | 78 ++++++++++++++++++++++------------------ config.yaml | 4 +-- 2 files changed, 45 insertions(+), 37 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 6e0b3ab..689aad9 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -9,6 +9,14 @@ on: branches: [main, develop] jobs: + canary: + runs-on: [self-hosted, macos-latest] + steps: + - run: | + uname -a + node -v || true + echo "Runner labels OK ✅" + test: runs-on: [self-hosted, macos-latest] strategy: @@ -110,41 +118,41 @@ jobs: performance: runs-on: [self-hosted, macos-latest] - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: { node-version: 20, cache: npm } - - run: npm ci - - - name: Install LHCI - run: npm i -D @lhci/cli - - # Ensure a Chrome binary is available (works on Linux/macOS runners) - - name: Install Chrome via Puppeteer (portable) - run: | - npx @puppeteer/browsers install chrome@stable -P .cache/puppeteer - echo "CHROME_PATH=$(npx @puppeteer/browsers executable-path chrome@stable -P .cache/puppeteer)" >> $GITHUB_ENV - - - name: Build application - run: npm run build - - - name: Start application - run: npm run preview & - env: { CI: true } - - - name: Wait for application - run: npx wait-on http://localhost:3000 - - - name: Run Lighthouse CI - run: npx lhci autorun --chrome-path="$CHROME_PATH" - env: { CI: true } - - - name: Upload LHCI results - if: always() - uses: actions/upload-artifact@v3 - with: - name: lhci-results - path: lhci-results + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: { node-version: 20, cache: npm } + - run: npm ci + + - name: Install LHCI + run: npm i -D @lhci/cli + + # Ensure a Chrome binary is available (works on Linux/macOS runners) + - name: Install Chrome via Puppeteer (portable) + run: | + npx @puppeteer/browsers install chrome@stable -P .cache/puppeteer + echo "CHROME_PATH=$(npx @puppeteer/browsers executable-path chrome@stable -P .cache/puppeteer)" >> $GITHUB_ENV + + - name: Build application + run: npm run build + + - name: Start application + run: npm run preview & + env: { CI: true } + + - name: Wait for application + run: npx wait-on http://localhost:3000 + + - name: Run Lighthouse CI + run: npx lhci autorun --chrome-path="$CHROME_PATH" + env: { CI: true } + + - name: Upload LHCI results + if: always() + uses: actions/upload-artifact@v3 + with: + name: lhci-results + path: lhci-results storybook: runs-on: [self-hosted, macos-latest] diff --git a/config.yaml b/config.yaml index 23f70bb..f49f086 100644 --- a/config.yaml +++ b/config.yaml @@ -9,8 +9,8 @@ runner: fetch_timeout: 5s fetch_interval: 2s labels: - - "macos-latest:host" - - "self-hosted:host" + - "self-hosted" + - "macos-latest" cache: enabled: true From 73798b588a5c199c59b6bbf6fe2c9527c35565c4 Mon Sep 17 00:00:00 2001 From: adilallo <39313955+adilallo@users.noreply.github.com> Date: Fri, 29 Aug 2025 21:13:08 -0600 Subject: [PATCH 2/7] Update workflow to match runner labels: Use self-hosted:host and macos-latest:host --- .gitea/workflows/ci.yaml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 689aad9..2a4265b 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -10,7 +10,7 @@ on: jobs: canary: - runs-on: [self-hosted, macos-latest] + runs-on: ["self-hosted:host", "macos-latest:host"] steps: - run: | uname -a @@ -18,7 +18,7 @@ jobs: echo "Runner labels OK ✅" test: - runs-on: [self-hosted, macos-latest] + runs-on: ["self-hosted:host", "macos-latest:host"] strategy: matrix: { node-version: [18, 20] } env: @@ -47,7 +47,7 @@ jobs: # bash codecov.sh -t "${{ secrets.CODECOV_TOKEN }}" -f coverage/lcov.info -F unittests e2e: - runs-on: [self-hosted, macos-latest] + runs-on: ["self-hosted:host", "macos-latest:host"] strategy: matrix: { browser: [chromium, firefox, webkit] } steps: @@ -80,7 +80,7 @@ jobs: retention-days: 30 visual-regression: - runs-on: [self-hosted, macos-latest] + runs-on: ["self-hosted:host", "macos-latest:host"] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -117,36 +117,36 @@ jobs: retention-days: 30 performance: - runs-on: [self-hosted, macos-latest] + runs-on: ["self-hosted:host", "macos-latest:host"] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: { node-version: 20, cache: npm } - run: npm ci - + - name: Install LHCI run: npm i -D @lhci/cli - + # Ensure a Chrome binary is available (works on Linux/macOS runners) - name: Install Chrome via Puppeteer (portable) run: | npx @puppeteer/browsers install chrome@stable -P .cache/puppeteer echo "CHROME_PATH=$(npx @puppeteer/browsers executable-path chrome@stable -P .cache/puppeteer)" >> $GITHUB_ENV - + - name: Build application run: npm run build - + - name: Start application run: npm run preview & env: { CI: true } - + - name: Wait for application run: npx wait-on http://localhost:3000 - + - name: Run Lighthouse CI run: npx lhci autorun --chrome-path="$CHROME_PATH" env: { CI: true } - + - name: Upload LHCI results if: always() uses: actions/upload-artifact@v3 @@ -155,7 +155,7 @@ jobs: path: lhci-results storybook: - runs-on: [self-hosted, macos-latest] + runs-on: ["self-hosted:host", "macos-latest:host"] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -166,7 +166,7 @@ jobs: env: { CI: true } lint: - runs-on: [self-hosted, macos-latest] + runs-on: ["self-hosted:host", "macos-latest:host"] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -176,7 +176,7 @@ jobs: - run: npx prettier --check "**/*.{js,jsx,ts,tsx,json,css,md}" build: - runs-on: [self-hosted, macos-latest] + runs-on: ["self-hosted:host", "macos-latest:host"] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 From 25c262e6eb7793c7fe554bafe63562879cc46a1a Mon Sep 17 00:00:00 2001 From: adilallo <39313955+adilallo@users.noreply.github.com> Date: Fri, 29 Aug 2025 21:14:11 -0600 Subject: [PATCH 3/7] Runner update --- .runner | 12 ++++++------ .runner.pid | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) delete mode 100644 .runner.pid diff --git a/.runner b/.runner index 87f9b4c..3cd2e93 100644 --- a/.runner +++ b/.runner @@ -1,12 +1,12 @@ { "WARNING": "This file is automatically generated by act-runner. Do not edit it manually unless you know what you are doing. Removing this file will cause act runner to re-register as a new runner.", - "id": 7, - "uuid": "3a8b9f5a-189b-47a3-b0b1-1a06c933cc06", - "name": "community-rule-runner-1", - "token": "23ecad1165282704291cfa5112a36aebfadfa40a", + "id": 12, + "uuid": "1f114e7b-9330-40fc-9c96-816b07f3e4c2", + "name": "community-rule-test-runner", + "token": "ba42513830cbc9e2eb6abf86ee119fadfcb7a14b", "address": "https://git.medlab.host", "labels": [ - "macos-latest:host", - "self-hosted:host" + "self-hosted:host", + "macos-latest:host" ] } diff --git a/.runner.pid b/.runner.pid deleted file mode 100644 index 5c1838f..0000000 --- a/.runner.pid +++ /dev/null @@ -1 +0,0 @@ -39731 From c8f72e6ec653587b2c7a397658943c7710db29dd Mon Sep 17 00:00:00 2001 From: adilallo <39313955+adilallo@users.noreply.github.com> Date: Fri, 29 Aug 2025 21:25:26 -0600 Subject: [PATCH 4/7] Update runner config and workflow to use host mode --- config.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config.yaml b/config.yaml index f49f086..f6ac342 100644 --- a/config.yaml +++ b/config.yaml @@ -9,8 +9,8 @@ runner: fetch_timeout: 5s fetch_interval: 2s labels: - - "self-hosted" - - "macos-latest" + - "self-hosted:host" + - "macos-latest:host" cache: enabled: true @@ -27,6 +27,7 @@ container: valid_volumes: [] docker_host: "" force_pull: false + mode: "host" host: workdir_parent: "" From 62b1fd3d4a42c657eddb0668d111e312e7863384 Mon Sep 17 00:00:00 2001 From: adilallo <39313955+adilallo@users.noreply.github.com> Date: Fri, 29 Aug 2025 21:33:38 -0600 Subject: [PATCH 5/7] Create .runner.pid --- .runner.pid | 1 + 1 file changed, 1 insertion(+) create mode 100644 .runner.pid diff --git a/.runner.pid b/.runner.pid new file mode 100644 index 0000000..dea2b2b --- /dev/null +++ b/.runner.pid @@ -0,0 +1 @@ +35293 From 8965dd5878ade9b74a138c7900fd2c940721d185 Mon Sep 17 00:00:00 2001 From: adilallo <39313955+adilallo@users.noreply.github.com> Date: Fri, 29 Aug 2025 21:49:55 -0600 Subject: [PATCH 6/7] Test workflow trigger from working state --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9af8c81..d336bd3 100644 --- a/README.md +++ b/README.md @@ -178,3 +178,4 @@ community-rule/ ## 📄 License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. +# Test trigger From bead0c737303fb7e83b3be0c5dbd121b00351b90 Mon Sep 17 00:00:00 2001 From: adilallo <39313955+adilallo@users.noreply.github.com> Date: Fri, 29 Aug 2025 21:52:06 -0600 Subject: [PATCH 7/7] Fix duplicate triggers: Only run CI on PRs to main/develop, not feature branch pushes --- .gitea/workflows/ci.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 2a4265b..e27d05c 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -4,9 +4,10 @@ run-name: ${{ gitea.actor }} triggered CI pipeline on: workflow_dispatch: {} push: - branches: [main, develop, "fix-runner-trigger"] + branches: [main, develop] # only direct pushes/merges to protected branches pull_request: - branches: [main, develop] + branches: [main, develop] # PRs into main/develop + types: [opened, reopened, synchronize] jobs: canary: