bef and aft #4
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
name: Test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
install-playwright: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "22" | |
- name: Run Netdata | |
run: | | |
docker run -d --rm \ | |
--name netdata \ | |
--hostname node \ | |
--pid host \ | |
--network host \ | |
--cap-add SYS_PTRACE \ | |
--cap-add SYS_ADMIN \ | |
--security-opt apparmor=unconfined \ | |
-v /:/host/root:ro,rslave \ | |
-v /etc/passwd:/host/etc/passwd:ro \ | |
-v /etc/group:/host/etc/group:ro \ | |
-v /etc/localtime:/etc/localtime:ro \ | |
-v /proc:/host/proc:ro \ | |
-v /sys:/host/sys:ro \ | |
-v /etc/os-release:/host/etc/os-release:ro \ | |
-v /var/log:/host/var/log:ro \ | |
-v /var/run/docker.sock:/var/run/docker.sock:ro \ | |
-v /run/dbus:/run/dbus:ro \ | |
netdata/netdata | |
- name: Record after time | |
run: node -p "Math.floor(new Date().getTime() / 1000) * 1000" > /tmp/netdata_after | |
- name: Install Playwright and dependencies | |
run: pnpx playwright install --with-deps | |
- name: Record before time | |
run: node -p "Math.ceil(new Date().getTime() / 1000) * 1000" > /tmp/netdata_before | |
- name: Download JSON from Netdata | |
run: | | |
before="$(cat /tmp/netdata_before)" | |
after="$(cat /tmp/netdata_after)" | |
curl -o netdata.json "http://localhost:19999/api/v2/data?format=json&group_by=instance&after=$after&before=$before" | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: netdata | |
path: | | |
netdata.json |