mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-18 01:07:22 +00:00
ci: change to js
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user