From 96775d28ee78661f2f4ba874c948aa69218132a8 Mon Sep 17 00:00:00 2001
From: Palash Tyagi <23239946+Magnus167@users.noreply.github.com>
Date: Sun, 4 May 2025 18:20:27 +0100
Subject: [PATCH 01/17] renamed archive folder
---
.github/{archive => .archive}/pr-checks.yml | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename .github/{archive => .archive}/pr-checks.yml (100%)
diff --git a/.github/archive/pr-checks.yml b/.github/.archive/pr-checks.yml
similarity index 100%
rename from .github/archive/pr-checks.yml
rename to .github/.archive/pr-checks.yml
From 63f1a83c2d2325aeb3744e8e307a33166bb7b0eb Mon Sep 17 00:00:00 2001
From: Palash Tyagi <23239946+Magnus167@users.noreply.github.com>
Date: Sun, 4 May 2025 18:26:09 +0100
Subject: [PATCH 02/17] Refactor benchmark workflow to include runner selection
logic
---
.github/workflows/run-benchmarks.yml | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/run-benchmarks.yml b/.github/workflows/run-benchmarks.yml
index b05029e..f6cca7a 100644
--- a/.github/workflows/run-benchmarks.yml
+++ b/.github/workflows/run-benchmarks.yml
@@ -7,8 +7,22 @@ on:
# - main
jobs:
- run-benchmarks:
+ pick-runner:
runs-on: ubuntu-latest
+ outputs:
+ runner: ${{ steps.choose.outputs.use-runner }}
+ steps:
+ - uses: actions/checkout@v4
+ - id: choose
+ uses: ./.github/actions/runner-fallback
+ with:
+ primary-runner: "self-hosted,ubuntu-latest"
+ fallback-runner: "ubuntu-latest"
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+
+ run-benchmarks:
+ needs: pick-runner
+ runs-on: ${{ fromJson(needs.pick-runner.outputs.runner) }}
steps:
- name: Checkout code
From e74617f2e45f36ec8a5ea75192ae87beb9d8aa90 Mon Sep 17 00:00:00 2001
From: Palash Tyagi <23239946+Magnus167@users.noreply.github.com>
Date: Sun, 4 May 2025 18:41:02 +0100
Subject: [PATCH 03/17] Rename documentation output directory and update
redirect in index.html
---
.github/workflows/docs-and-testcov.yml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/docs-and-testcov.yml b/.github/workflows/docs-and-testcov.yml
index 94eab46..ddf5e71 100644
--- a/.github/workflows/docs-and-testcov.yml
+++ b/.github/workflows/docs-and-testcov.yml
@@ -101,7 +101,9 @@ jobs:
cp last-commit-date.json target/doc/rustframe/
mkdir -p target/doc/rustframe/.github
cp .github/rustframe_logo.png target/doc/rustframe/.github/
- echo "" > target/doc/index.html
+
+ mv target/doc/rustframe target/doc/docs
+ echo "" > target/doc/index.html
- name: Upload Pages artifact
if: github.event_name == 'push'
From 02c00cc65788aeee84c3ec6ae110cd5576ae0e25 Mon Sep 17 00:00:00 2001
From: Palash Tyagi <23239946+Magnus167@users.noreply.github.com>
Date: Sun, 4 May 2025 18:44:02 +0100
Subject: [PATCH 04/17] Update upload condition for Pages artifact to include
workflow_dispatch
---
.github/workflows/docs-and-testcov.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/docs-and-testcov.yml b/.github/workflows/docs-and-testcov.yml
index ddf5e71..ce46204 100644
--- a/.github/workflows/docs-and-testcov.yml
+++ b/.github/workflows/docs-and-testcov.yml
@@ -106,7 +106,7 @@ jobs:
echo "" > target/doc/index.html
- name: Upload Pages artifact
- if: github.event_name == 'push'
+ if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
uses: actions/upload-pages-artifact@v3
with:
path: target/doc/
From 18887e72ae805e9b421de3ae689a570ac8ff8d2b Mon Sep 17 00:00:00 2001
From: Palash Tyagi <23239946+Magnus167@users.noreply.github.com>
Date: Sun, 4 May 2025 18:48:26 +0100
Subject: [PATCH 05/17] Update deploy condition for GitHub Pages to include
workflow_dispatch
---
.github/workflows/docs-and-testcov.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/docs-and-testcov.yml b/.github/workflows/docs-and-testcov.yml
index ce46204..f59eebd 100644
--- a/.github/workflows/docs-and-testcov.yml
+++ b/.github/workflows/docs-and-testcov.yml
@@ -112,5 +112,5 @@ jobs:
path: target/doc/
- name: Deploy to GitHub Pages
- if: github.event_name == 'push'
+ if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
uses: actions/deploy-pages@v4
From 3f11068f9c0290599ec67247effd0af67b345d73 Mon Sep 17 00:00:00 2001
From: Palash Tyagi <23239946+Magnus167@users.noreply.github.com>
Date: Sun, 4 May 2025 20:53:32 +0100
Subject: [PATCH 06/17] Refactor documentation output structure and update
index redirect
---
.github/workflows/docs-and-testcov.yml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/docs-and-testcov.yml b/.github/workflows/docs-and-testcov.yml
index f59eebd..3073481 100644
--- a/.github/workflows/docs-and-testcov.yml
+++ b/.github/workflows/docs-and-testcov.yml
@@ -102,7 +102,9 @@ jobs:
mkdir -p target/doc/rustframe/.github
cp .github/rustframe_logo.png target/doc/rustframe/.github/
- mv target/doc/rustframe target/doc/docs
+ mkdir -p target/doc/docs
+ mv target/doc/rustframe/ target/doc/docs/
+
echo "" > target/doc/index.html
- name: Upload Pages artifact
From a62c24304ecd8cb9e9eec05e868130a5831aed6f Mon Sep 17 00:00:00 2001
From: Palash Tyagi <23239946+Magnus167@users.noreply.github.com>
Date: Sun, 4 May 2025 21:14:35 +0100
Subject: [PATCH 07/17] Update index redirect and comment out deploy conditions
for Pages
---
.github/workflows/docs-and-testcov.yml | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/.github/workflows/docs-and-testcov.yml b/.github/workflows/docs-and-testcov.yml
index 3073481..bd4c5f9 100644
--- a/.github/workflows/docs-and-testcov.yml
+++ b/.github/workflows/docs-and-testcov.yml
@@ -101,18 +101,14 @@ jobs:
cp last-commit-date.json target/doc/rustframe/
mkdir -p target/doc/rustframe/.github
cp .github/rustframe_logo.png target/doc/rustframe/.github/
-
- mkdir -p target/doc/docs
- mv target/doc/rustframe/ target/doc/docs/
-
- echo "" > target/doc/index.html
+ echo "" > target/doc/index.html
- name: Upload Pages artifact
- if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
+ # if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
uses: actions/upload-pages-artifact@v3
with:
path: target/doc/
- name: Deploy to GitHub Pages
- if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
- uses: actions/deploy-pages@v4
+ # if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
+ uses: actions/deploy-pages@v4
\ No newline at end of file
From 6d79797266a276471dfb65de5a3ef946ab234ab8 Mon Sep 17 00:00:00 2001
From: Palash Tyagi <23239946+Magnus167@users.noreply.github.com>
Date: Sun, 4 May 2025 21:15:27 +0100
Subject: [PATCH 08/17] Update push branches in docs-and-testcov workflow to
include update_docs_workflow
---
.github/workflows/docs-and-testcov.yml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/docs-and-testcov.yml b/.github/workflows/docs-and-testcov.yml
index bd4c5f9..494334a 100644
--- a/.github/workflows/docs-and-testcov.yml
+++ b/.github/workflows/docs-and-testcov.yml
@@ -6,9 +6,9 @@ concurrency:
on:
push:
- branches: [main]
-# pull_request:
-# branches: [main]
+ branches: [main, update_docs_workflow]
+ # pull_request:
+ # branches: [main]
workflow_dispatch:
permissions:
From 88d1d6b3ff98bd89eec42393a492726202ebe82a Mon Sep 17 00:00:00 2001
From: Palash Tyagi <23239946+Magnus167@users.noreply.github.com>
Date: Sun, 4 May 2025 21:23:23 +0100
Subject: [PATCH 09/17] Update primary-runner configuration to use self-hosted
only in workflows
---
.github/workflows/docs-and-testcov.yml | 2 +-
.github/workflows/run-benchmarks.yml | 2 +-
.github/workflows/run-unit-tests.yml | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/docs-and-testcov.yml b/.github/workflows/docs-and-testcov.yml
index 494334a..7bf2048 100644
--- a/.github/workflows/docs-and-testcov.yml
+++ b/.github/workflows/docs-and-testcov.yml
@@ -27,7 +27,7 @@ jobs:
- id: choose
uses: ./.github/actions/runner-fallback
with:
- primary-runner: "self-hosted,ubuntu-latest"
+ primary-runner: "self-hosted"
fallback-runner: "ubuntu-latest"
github-token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/run-benchmarks.yml b/.github/workflows/run-benchmarks.yml
index f6cca7a..86e3c69 100644
--- a/.github/workflows/run-benchmarks.yml
+++ b/.github/workflows/run-benchmarks.yml
@@ -16,7 +16,7 @@ jobs:
- id: choose
uses: ./.github/actions/runner-fallback
with:
- primary-runner: "self-hosted,ubuntu-latest"
+ primary-runner: "self-hosted"
fallback-runner: "ubuntu-latest"
github-token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/run-unit-tests.yml b/.github/workflows/run-unit-tests.yml
index 2b8cd8f..dfc743b 100644
--- a/.github/workflows/run-unit-tests.yml
+++ b/.github/workflows/run-unit-tests.yml
@@ -21,7 +21,7 @@ jobs:
- id: choose
uses: ./.github/actions/runner-fallback
with:
- primary-runner: "self-hosted,ubuntu-latest"
+ primary-runner: "self-hosted"
fallback-runner: "ubuntu-latest"
github-token: ${{ secrets.GITHUB_TOKEN }}
From 186dffe29b01c487c0079130b964c267702d2ab6 Mon Sep 17 00:00:00 2001
From: Palash Tyagi <23239946+Magnus167@users.noreply.github.com>
Date: Sun, 4 May 2025 21:27:14 +0100
Subject: [PATCH 10/17] Update output directory structure for documentation and
coverage reports
---
.github/workflows/docs-and-testcov.yml | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/.github/workflows/docs-and-testcov.yml b/.github/workflows/docs-and-testcov.yml
index 7bf2048..6fa7bb4 100644
--- a/.github/workflows/docs-and-testcov.yml
+++ b/.github/workflows/docs-and-testcov.yml
@@ -94,14 +94,18 @@ jobs:
- name: Copy files to output directory
run: |
+ # mkdir docs
+ mkdir -p target/doc/docs
+ cp -r target/doc/rustframe/* target/doc/docs/
+
mkdir output
- cp tarpaulin-report.html target/doc/rustframe/
- cp tarpaulin-report.json target/doc/rustframe/
- cp tarpaulin-badge.json target/doc/rustframe/
- cp last-commit-date.json target/doc/rustframe/
- mkdir -p target/doc/rustframe/.github
- cp .github/rustframe_logo.png target/doc/rustframe/.github/
- echo "" > target/doc/index.html
+ cp tarpaulin-report.html target/doc/docs/
+ cp tarpaulin-report.json target/doc/docs/
+ cp tarpaulin-badge.json target/doc/docs/
+ cp last-commit-date.json target/doc/docs/
+ mkdir -p target/doc/docs/.github
+ cp .github/rustframe_logo.png target/doc/docs/.github/
+ echo "" > target/doc/index.html
- name: Upload Pages artifact
# if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
From 5cca2ca1491ac909874cc7ac449d607f8fdf2fad Mon Sep 17 00:00:00 2001
From: Palash Tyagi <23239946+Magnus167@users.noreply.github.com>
Date: Mon, 5 May 2025 00:32:30 +0100
Subject: [PATCH 11/17] Update coverage badge URL in README.md to point to the
correct documentation path
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 931b463..490deea 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@
[](https://codecov.io/gh/Magnus167/rustframe)
-[](https://magnus167.github.io/rustframe/rustframe/tarpaulin-report.html)
+[](https://magnus167.github.io/rustframe/docs/tarpaulin-report.html)
---
From ac4d67146e8d676a0d6c715530b5bb40e1d9f0bf Mon Sep 17 00:00:00 2001
From: Palash Tyagi <23239946+Magnus167@users.noreply.github.com>
Date: Mon, 5 May 2025 00:34:48 +0100
Subject: [PATCH 12/17] Add error handling for fetching runners in
runner-fallback action
---
.github/actions/runner-fallback/action.yml | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/.github/actions/runner-fallback/action.yml b/.github/actions/runner-fallback/action.yml
index 9b320f2..8abc9d6 100644
--- a/.github/actions/runner-fallback/action.yml
+++ b/.github/actions/runner-fallback/action.yml
@@ -40,6 +40,13 @@ runs:
runners=$(curl -s -H "Authorization: Bearer $TOKEN" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/$repo/actions/runners?per_page=100")
+
+ # Check if runners is null or empty
+ if [ -z "$runners" ] || [ "$runners" = "null" ]; then
+ echo "❌ Error: Unable to fetch runners or no runners found." >&2
+ exit 1
+ fi
+
# Split wanted labels
IFS=',' read -ra WANT <<<"$PRIMARY"
online_found=0
From 5f1bb68723b8a131fad5e832f25f9d9cc32f96a9 Mon Sep 17 00:00:00 2001
From: Palash Tyagi <23239946+Magnus167@users.noreply.github.com>
Date: Mon, 5 May 2025 00:36:42 +0100
Subject: [PATCH 13/17] Add debug logging for runners response in
runner-fallback action
---
.github/actions/runner-fallback/action.yml | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/.github/actions/runner-fallback/action.yml b/.github/actions/runner-fallback/action.yml
index 8abc9d6..9b9ec37 100644
--- a/.github/actions/runner-fallback/action.yml
+++ b/.github/actions/runner-fallback/action.yml
@@ -41,13 +41,16 @@ runs:
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/$repo/actions/runners?per_page=100")
+ # Debug: Print runners content
+ echo "Runners response: $runners"
+
# Check if runners is null or empty
if [ -z "$runners" ] || [ "$runners" = "null" ]; then
echo "❌ Error: Unable to fetch runners or no runners found." >&2
exit 1
fi
- # Split wanted labels
+ # Process runners only if valid
IFS=',' read -ra WANT <<<"$PRIMARY"
online_found=0
while read -r row; do
From eb21f21dcb2a47a4fb7314bb42eb49528d041e30 Mon Sep 17 00:00:00 2001
From: Palash Tyagi <23239946+Magnus167@users.noreply.github.com>
Date: Mon, 5 May 2025 00:46:21 +0100
Subject: [PATCH 14/17] Remove github-token input and use CUSTOM_GH_TOKEN
secret for authentication in runner-fallback action
---
.github/actions/runner-fallback/action.yml | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/.github/actions/runner-fallback/action.yml b/.github/actions/runner-fallback/action.yml
index 9b9ec37..cc66ecb 100644
--- a/.github/actions/runner-fallback/action.yml
+++ b/.github/actions/runner-fallback/action.yml
@@ -10,9 +10,6 @@ inputs:
fallback-runner:
description: 'Comma-separated label list or single label for the fallback (e.g. "ubuntu-latest")'
required: true
- github-token:
- description: "PAT or GITHUB_TOKEN with `repo` scope"
- required: true
outputs:
use-runner:
@@ -26,7 +23,7 @@ runs:
id: pick
shell: bash
env:
- TOKEN: ${{ inputs.github-token }}
+ TOKEN: ${{ secrets.CUSTOM_GH_TOKEN }}
PRIMARY: ${{ inputs.primary-runner }}
FALLBACK: ${{ inputs.fallback-runner }}
run: |
From 179553fe38cff12134702ac594cf9f711e8410c9 Mon Sep 17 00:00:00 2001
From: Palash Tyagi <23239946+Magnus167@users.noreply.github.com>
Date: Mon, 5 May 2025 00:47:14 +0100
Subject: [PATCH 15/17] Add comments to clarify token permissions in
runner-fallback action
---
.github/actions/runner-fallback/action.yml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.github/actions/runner-fallback/action.yml b/.github/actions/runner-fallback/action.yml
index cc66ecb..0a31714 100644
--- a/.github/actions/runner-fallback/action.yml
+++ b/.github/actions/runner-fallback/action.yml
@@ -23,6 +23,8 @@ runs:
id: pick
shell: bash
env:
+ # token needs to have reop admin read permissions
+ # https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-a-repository
TOKEN: ${{ secrets.CUSTOM_GH_TOKEN }}
PRIMARY: ${{ inputs.primary-runner }}
FALLBACK: ${{ inputs.fallback-runner }}
From 80083ce77c7051d385557ef5b513fcbc6b3cbb5d Mon Sep 17 00:00:00 2001
From: Palash Tyagi <23239946+Magnus167@users.noreply.github.com>
Date: Mon, 5 May 2025 00:52:52 +0100
Subject: [PATCH 16/17] Refactor github-token input to use CUSTOM_GH_TOKEN
secret for authentication in runner-fallback action
---
.github/actions/runner-fallback/action.yml | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/.github/actions/runner-fallback/action.yml b/.github/actions/runner-fallback/action.yml
index 0a31714..ea0b805 100644
--- a/.github/actions/runner-fallback/action.yml
+++ b/.github/actions/runner-fallback/action.yml
@@ -10,6 +10,10 @@ inputs:
fallback-runner:
description: 'Comma-separated label list or single label for the fallback (e.g. "ubuntu-latest")'
required: true
+ github-token:
+ description: 'GitHub token with repo admin read permissions'
+ required: false
+ default: ${{ secrets.CUSTOM_GH_TOKEN }}
outputs:
use-runner:
@@ -23,9 +27,7 @@ runs:
id: pick
shell: bash
env:
- # token needs to have reop admin read permissions
- # https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-a-repository
- TOKEN: ${{ secrets.CUSTOM_GH_TOKEN }}
+ TOKEN: ${{ inputs.github-token }}
PRIMARY: ${{ inputs.primary-runner }}
FALLBACK: ${{ inputs.fallback-runner }}
run: |
From 7e27539529cdbb925e898fabad998ce95067097a Mon Sep 17 00:00:00 2001
From: Palash Tyagi <23239946+Magnus167@users.noreply.github.com>
Date: Mon, 5 May 2025 01:04:56 +0100
Subject: [PATCH 17/17] Update GitHub token input to require CUSTOM_GH_TOKEN
for authentication in workflows
---
.github/actions/runner-fallback/action.yml | 5 +++--
.github/workflows/docs-and-testcov.yml | 2 +-
.github/workflows/run-benchmarks.yml | 2 +-
.github/workflows/run-unit-tests.yml | 6 +++++-
4 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/.github/actions/runner-fallback/action.yml b/.github/actions/runner-fallback/action.yml
index ea0b805..31bb0fe 100644
--- a/.github/actions/runner-fallback/action.yml
+++ b/.github/actions/runner-fallback/action.yml
@@ -12,8 +12,9 @@ inputs:
required: true
github-token:
description: 'GitHub token with repo admin read permissions'
- required: false
- default: ${{ secrets.CUSTOM_GH_TOKEN }}
+ required: true
+
+
outputs:
use-runner:
diff --git a/.github/workflows/docs-and-testcov.yml b/.github/workflows/docs-and-testcov.yml
index 6fa7bb4..346335f 100644
--- a/.github/workflows/docs-and-testcov.yml
+++ b/.github/workflows/docs-and-testcov.yml
@@ -29,7 +29,7 @@ jobs:
with:
primary-runner: "self-hosted"
fallback-runner: "ubuntu-latest"
- github-token: ${{ secrets.GITHUB_TOKEN }}
+ github-token: ${{ secrets.CUSTOM_GH_TOKEN }}
docs-and-testcov:
needs: pick-runner
diff --git a/.github/workflows/run-benchmarks.yml b/.github/workflows/run-benchmarks.yml
index 86e3c69..a7c3044 100644
--- a/.github/workflows/run-benchmarks.yml
+++ b/.github/workflows/run-benchmarks.yml
@@ -18,7 +18,7 @@ jobs:
with:
primary-runner: "self-hosted"
fallback-runner: "ubuntu-latest"
- github-token: ${{ secrets.GITHUB_TOKEN }}
+ github-token: ${{ secrets.CUSTOM_GH_TOKEN }}
run-benchmarks:
needs: pick-runner
diff --git a/.github/workflows/run-unit-tests.yml b/.github/workflows/run-unit-tests.yml
index dfc743b..1aa68c5 100644
--- a/.github/workflows/run-unit-tests.yml
+++ b/.github/workflows/run-unit-tests.yml
@@ -12,18 +12,22 @@ concurrency:
jobs:
pick-runner:
+
if: github.event.pull_request.draft == false
+
runs-on: ubuntu-latest
outputs:
runner: ${{ steps.choose.outputs.use-runner }}
steps:
+
- uses: actions/checkout@v4
- id: choose
uses: ./.github/actions/runner-fallback
with:
primary-runner: "self-hosted"
fallback-runner: "ubuntu-latest"
- github-token: ${{ secrets.GITHUB_TOKEN }}
+ github-token: ${{ secrets.CUSTOM_GH_TOKEN }}
+
run-unit-tests:
needs: pick-runner