-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (45 loc) · 1.44 KB
/
server-e2e-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Server E2E Tests
on:
push:
branches: [main]
paths:
- 'server/**'
- 'compile_server_os/**'
- '.github/workflows/server-e2e-tests.yml'
pull_request:
branches: [main]
paths:
- 'server/**'
- 'compile_server_os/**'
- '.github/workflows/server-e2e-tests.yml'
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v9
- name: Restore and Cache Nix Store
uses: nix-community/cache-nix-action@v5
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
save-always: true
- name: Install QEMU
run: |
sudo apt-get update
sudo apt-get install -y qemu-system-x86 curl
- name: Build VM
working-directory: compile_server_os
run: |
nix build .#nixosConfigurations.host-eons-slc.config.system.build.vm
sudo mv result/bin/run-*-vm vm-run
- name: Start VM
working-directory: compile_server_os
run: |
sudo ./vm-run --no-reboot -nic user,hostfwd=tcp::3000-:3000 &
sleep 60 # TODO: Replace with waiting for server to come online
- name: Run Tests
run: |
curl --fail http://localhost:3000 || (echo "Server not reachable!" && exit 1)