Skip to content

Commit

Permalink
Aligns
Browse files Browse the repository at this point in the history
  • Loading branch information
igorpecovnik committed Jan 7, 2025
1 parent 3c2b833 commit 51ef631
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/generate-runners-status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
Check:

name: "Check permissions"
runs-on: "ubuntu-24.04"
runs-on: "ubuntu-22.04"
steps:

- name: "Check permissions"
Expand All @@ -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 }}
Expand All @@ -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')
Expand All @@ -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
Expand Down

0 comments on commit 51ef631

Please sign in to comment.