-
Notifications
You must be signed in to change notification settings - Fork 15
102 lines (101 loc) · 3.44 KB
/
test.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: test
on: [push]
jobs:
build:
name: Test Guix installation
runs-on: ubuntu-latest
steps:
- name: Guix cache
uses: actions/cache@v3
with:
path: ~/.cache/guix
# use a key that (almost) never matches
key: guix-cache-${{ github.sha }}
restore-keys: |
guix-cache-
# Cannot use a cache for /gnu/store, since restore fails
- name: Install Guix
uses: PromyLOPh/guix-install-action@v1
- name: Ensure no locale warning
run: test -z "$(guix --version 2>&1 >/dev/null)"
- name: Build hello
run: guix build hello
# Pack independent binary
- name: Pack (Relocatable Binary)
run: guix pack --relocatable --save-provenance --root=hello.tar.bz2 --compression=bzip2 hello
# Create a docker image
- name: Pack (Docker)
run: guix pack --save-provenance --format=docker --entry-point=bin/hello --root=hello-docker.tar.gz hello
# Create a NAR archive, which can be used on substitute servers or for
# `guix archive`
- name: Nar
run: guix archive --export hello > hello.nar
# Upload all artifacts
- name: Upload pack (Relocatable Binary)
uses: actions/upload-artifact@v2
with:
name: hello Relocatable Binary
path: hello.tar.bz2
- name: Upload pack (Docker)
uses: actions/upload-artifact@v2
with:
name: hello Docker image
path: hello-docker.tar.gz
# Store auto-generated signing key as well, so it can be authenticated
# later
- name: Upload nar
uses: actions/upload-artifact@v2
with:
name: hello nar
path: |
hello.nar
/etc/guix/signing-key.pub
build-with-channels:
name: Test Guix installation with different channels
runs-on: ubuntu-latest
steps:
- name: Guix cache
uses: actions/cache@v3
with:
path: ~/.cache/guix
# use a key that (almost) never matches
key: guix-cache-${{ github.sha }}
restore-keys: |
guix-cache-
# Cannot use a cache for /gnu/store, since restore fails
- name: Install Guix
id: install-guix
uses: PromyLOPh/guix-install-action@v1
with:
channels: |-
(cons
(channel
(name 'guix-science)
(url "https://github.com/guix-science/guix-science.git")
(introduction
(make-channel-introduction
"b1fe5aaff3ab48e798a4cce02f0212bc91f423dc"
(openpgp-fingerprint
"CA4F 8CF4 37D7 478F DA05 5FD4 4213 7701 1A37 8446"))))
%default-channels)
- name: Build from external channel
run: guix build python-jupyterlab
# Test that the channels output can be pulled. This operation should
# complete quickly.
- name: Build with time machine
run: |
cat <<EOF > ${{ runner.temp }}/channels.scm
${{ steps.install-guix.outputs.channels }}
EOF
guix time-machine -C ${{ runner.temp }}/channels.scm -- build python-jupyterlab
build-without-pull:
name: Test without pulling
runs-on: ubuntu-latest
steps:
- name: Install Guix
id: install-guix
uses: PromyLOPh/guix-install-action@v1
with:
pullAfterInstall: false
- name: Build hello
run: guix build hello