ci: change to js

This commit is contained in:
H01001000
2023-03-08 14:47:19 -08:00
parent bf2ce54260
commit 2fef7200a5
3 changed files with 13 additions and 12 deletions
+6 -1
View File
@@ -10,4 +10,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: ./scripts/checkCpuModel.sh
- uses: actions/setup-node@v3
with:
node-version: 18
- run: node ./scripts/checkCpuModel.js
+7
View File
@@ -0,0 +1,7 @@
import os from 'node:os'
const hostCpu = os.cpus()[0].model
const targetCpu = await fetch('https://raw.githubusercontent.com/discordeno/discordeno/benchies/cpu').then((res) => res.text())
console.log(`host cpu: ${hostCpu} target cpu: ${targetCpu}`)
if (hostCpu !== targetCpu) process.exit(1)
-11
View File
@@ -1,11 +0,0 @@
#!/bin/bash
hostCpu=$(lscpu | sed -nr '/Model name/ s/.*:\s*(.*) @ .*/\1/p')
targetCpu=$(curl https://raw.githubusercontent.com/discordeno/discordeno/benchies/cpu)
echo "host: ${hostCpu} target: ${targetCpu}"
if [ "$hostCpu" == "$targetCpu" ]; then
exit 1
else
exit 0
fi