aboutsummaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 0a594c198a5cd391ef193aab99d40c98cf96f783 (plain)
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
variables:
  SSH_LOCATION: "root@192.168.1.246"

stages:
- deploy
- benchmark

default:
  image: alpine
  before_script:
    - apk update && apk add openssh-client
    - eval $(ssh-agent -s)
    - chmod 400 "$SSH_PRIVATE_KEY"
    - ssh-add "$SSH_PRIVATE_KEY"
    - mkdir -p ~/.ssh
    - chmod 700 ~/.ssh
    - cp "$SSH_KNOWN_HOSTS" ~/.ssh/known_hosts

rebuild:
  when: manual
  stage: deploy
  resource_group: vm
  script:
    - ssh $SSH_LOCATION "bash -lc 'cd /opt/candelabra && git pull && NIXOS_SWITCH_USE_DIRTY_ENV=1 nixos-rebuild switch --fast --flake .#default'"

cost-models:
  when: manual
  stage: benchmark
  needs: ["rebuild"]
  timeout: 6 hours
  resource_group: vm
  script:
    - ssh $SSH_LOCATION "bash -lc 'cd /opt/candelabra/src && just cost-models'"

selections:
  when: manual
  stage: benchmark
  needs: ["rebuild"]
  timeout: 6 hours
  resource_group: vm
  script:
    - ssh $SSH_LOCATION "bash -lc 'cd /opt/candelabra/src && just selections'"

comparisons:
  when: manual
  stage: benchmark
  needs: ["rebuild"]
  timeout: 6 hours
  resource_group: vm
  script:
    - ssh $SSH_LOCATION "bash -lc 'cd /opt/candelabra/src && rm -fr tests/target/criterion && just selections --compare'"