-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3c2b833
commit 51ef631
Showing
1 changed file
with
15 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ jobs: | |
Check: | ||
|
||
name: "Check permissions" | ||
runs-on: "ubuntu-24.04" | ||
runs-on: "ubuntu-22.04" | ||
steps: | ||
|
||
- name: "Check permissions" | ||
|
@@ -34,9 +34,20 @@ jobs: | |
- name: "Install dependencies: jq" | ||
uses: awalsh128/cache-apt-pkgs-action@latest | ||
with: | ||
packages: jq | ||
packages: jq resolvconf | ||
version: 1.0 | ||
|
||
- name: "Test connection" | ||
run: | | ||
sudo apt-get -y install wireguard-tools | ||
echo "${{ secrets.WIREGUARD_LAB }}" > wg0.conf | ||
sudo chmod 600 wg0.conf | ||
echo "setting config" | ||
systemctl enable [email protected] | ||
sudo wg-quick up ./wg0.conf | ||
#ping 10.0.60.8 -c 5 | ||
- name: "Get runners from ORG" | ||
env: | ||
GH_TOKEN: ${{ secrets.RUNNERS }} | ||
|
@@ -52,7 +63,7 @@ jobs: | |
done | ||
echo "<table>" >> $GITHUB_STEP_SUMMARY | ||
echo "<tr><td>Name</td><td>CPU cores</td><td>Memory GB</td><td>Storage GB</td><td alignt=right>Runners</td></tr>" >> $GITHUB_STEP_SUMMARY | ||
echo "<tr><td>Name</td><td alignt=right>CPU cores</td><td alignt=right>Memory GB</td><td alignt=right>Storage GB</td><td alignt=right>Runners</td></tr>" >> $GITHUB_STEP_SUMMARY | ||
SERVERS=$(curl -s -H "Authorization: Token ${{ secrets.NETBOX_TOKEN }}" -H "Accept: application/json; indent=4" \ | ||
"${{ secrets.NETBOX_API }}/virtualization/virtual-machines/?limit=500&name__empty=false&role=userlevel-runner&status=active" \ | ||
| jq -r '.results[] | .id') | ||
|
@@ -66,7 +77,7 @@ jobs: | |
echo -e "<tr><td colspan=5>" >> $GITHUB_STEP_SUMMARY | ||
for runner in $(seq -f "%02g" 1 $RUNNERS | sed -e "s/.*/$NAME-&/"); do | ||
INFO=$(cat runners.json | jq -r '.runners[] | select(.name | startswith("'$runner'"))' | jq -r '.name,.status,.busy' | xargs -n3 -d'\n' | sort | uniq) | ||
[[ -n $INFO ]] && echo ":+1:" >> $GITHUB_STEP_SUMMARY || echo ":exclamation: <small>($runner)</small>" >> $GITHUB_STEP_SUMMARY | ||
[[ -n $INFO || ${NAME} == github ]] && echo ":+1:" >> $GITHUB_STEP_SUMMARY || echo ":exclamation: <small>($runner)</small>" >> $GITHUB_STEP_SUMMARY | ||
done | ||
echo -e "</td></tr>" >> $GITHUB_STEP_SUMMARY | ||
done | ||
|