-
Notifications
You must be signed in to change notification settings - Fork 3
71 lines (60 loc) · 2.02 KB
/
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: "Testing"
on:
pull_request:
push:
branches: [ "main" ]
env:
NIXPKGS_ALLOW_INSECURE: "1"
NIXPKGS_ALLOW_UNFREE: "1"
jobs:
build:
runs-on: [ Linux, self-hosted ]
steps:
- uses: actions/checkout@v3
- name: "Add Nix to path if already installed"
run: |
if [ -d "/nix/var/nix/profiles/default/bin" ]; then
echo "/nix/var/nix/profiles/default/bin" > "$GITHUB_PATH"
fi
- uses: CERT/install-nix-action@v25
- name: "Install the deploy key"
env:
DEPLOY_KEY: "${{ secrets.DEPLOY_KEY }}"
run: |
mkdir -p ~/.ssh
ssh_agent_vars=$(ssh-agent -s)
eval "$ssh_agent_vars"
echo "$ssh_agent_vars" | fgrep '=' | cut -d';' -f1 >> "$GITHUB_ENV"
echo "$DEPLOY_KEY" | ssh-add -
ssh-keyscan github.cert.corp >> ~/.ssh/known_hosts
cat ~/.ssh/known_hosts | sort -u > ~/.ssh/known_hosts.new
mv ~/.ssh/known_hosts.new ~/.ssh/known_hosts
- name: "Build nix-shell derivation"
run: nix-build shell.nix
tests:
runs-on: [ Linux, self-hosted ]
needs: build
steps:
- uses: actions/checkout@v3
- name: "Add Nix to path if already installed"
run: |
if [ -d "/nix/var/nix/profiles/default/bin" ]; then
echo "/nix/var/nix/profiles/default/bin" > "$GITHUB_PATH"
fi
- uses: CERT/install-nix-action@v25
- name: "Install the deploy key"
env:
DEPLOY_KEY: "${{ secrets.DEPLOY_KEY }}"
run: |
mkdir -p ~/.ssh
ssh_agent_vars=$(ssh-agent -s)
eval "$ssh_agent_vars"
echo "$ssh_agent_vars" | fgrep '=' | cut -d';' -f1 >> "$GITHUB_ENV"
echo "$DEPLOY_KEY" | ssh-add -
ssh-keyscan github.cert.corp >> ~/.ssh/known_hosts
cat ~/.ssh/known_hosts | sort -u > ~/.ssh/known_hosts.new
mv ~/.ssh/known_hosts.new ~/.ssh/known_hosts
- name: "Run test suite"
run: |
cd tests
bash run_tests.sh