-
Notifications
You must be signed in to change notification settings - Fork 51
149 lines (142 loc) · 5.1 KB
/
guix.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: ci/gh-actions/guix
on:
push:
env:
APT_SET_CONF: |
echo "Acquire::Retries \"3\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
echo "Acquire::http::Timeout \"120\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
echo "Acquire::ftp::Timeout \"120\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
jobs:
cache-sources:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: depends sources cache
id: cache
uses: actions/cache@v3
with:
path: contrib/depends/sources
key: sources-${{ hashFiles('contrib/depends/packages/*') }}
- name: download depends sources
if: steps.cache.outputs.cache-hit != 'true'
run: make -C contrib/depends download
cache-guix:
runs-on: ubuntu-latest
needs: [cache-sources]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: guix cache
id: cache
uses: actions/cache@v3
with:
path: |
gnu/store
guix_db.sqlite
key: guix-${{ hashFiles('contrib/guix/manifest.scm') }}
- name: move guix store
if: steps.cache.outputs.cache-hit != 'true'
run: |
if [[ -e "guix_db.sqlite" ]]; then
sudo mkdir -p /var/guix/db
sudo mv gnu /gnu
sudo cp guix_db.sqlite /var/guix/db/db.sqlite
sudo chmod 1775 /gnu/store
sudo chown 0644 /var/guix/db/db.sqlite
sudo chown -R root:root /gnu/store /var/guix/db/db.sqlite
fi
- name: depends sources cache
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/cache/restore@v3
with:
path: contrib/depends/sources
key: sources-${{ hashFiles('contrib/depends/packages/*') }}
- name: set apt conf
if: steps.cache.outputs.cache-hit != 'true'
run: ${{env.APT_SET_CONF}}
- name: install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: sudo apt update; sudo apt -y install guix git ca-certificates
- name: dry run
if: steps.cache.outputs.cache-hit != 'true'
run: DRY_RUN=1 SUBSTITUTE_URLS='http://ci.guix.gnu.org' JOBS=2 ./contrib/guix/guix-build
- name: prepare guix store for caching
if: steps.cache.outputs.cache-hit != 'true'
run: |
sudo systemctl stop guix-daemon
sudo mv /gnu gnu
sudo mv /var/guix/db/db.sqlite guix_db.sqlite
build-guix:
runs-on: ubuntu-latest
needs: [cache-guix]
strategy:
fail-fast: false
matrix:
toolchain:
- name: "x86_64-linux-gnu"
host: "x86_64-linux-gnu"
- name: "x86_64-linux-gnu.no-tor-bundle"
host: "x86_64-linux-gnu.no-tor-bundle"
- name: "x86_64-linux-gnu.pack"
host: "x86_64-linux-gnu.pack"
- name: "aarch64-linux-gnu"
host: "aarch64-linux-gnu"
- name: "arm-linux-gnueabihf"
host: "arm-linux-gnueabihf"
- name: "riscv64-linux-gnu"
host: "riscv64-linux-gnu"
- name: "x86_64-w64-mingw32"
host: "x86_64-w64-mingw32"
- name: "x86_64-w64-mingw32.installer"
host: "x86_64-w64-mingw32.installer"
- name: "x86_64-apple-darwin"
host: "x86_64-apple-darwin"
- name: "arm64-apple-darwin"
host: "arm64-apple-darwin"
name: ${{ matrix.toolchain.name }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: guix cache
uses: actions/cache/restore@v3
with:
path: |
gnu/store
guix_db.sqlite
key: guix-${{ hashFiles('contrib/guix/manifest.scm') }}
- name: move guix store
run: |
if [[ -e "guix_db.sqlite" ]]; then
sudo mkdir -p /var/guix/db
sudo mv gnu /gnu
sudo cp guix_db.sqlite /var/guix/db/db.sqlite
sudo chmod 1775 /gnu/store
sudo chown 0644 /var/guix/db/db.sqlite
sudo chown -R root:root /gnu/store /var/guix/db/db.sqlite
fi
- name: depends cache
uses: actions/cache@v3
with:
path: contrib/depends/built
key: depends-${{ matrix.toolchain.host }}-${{ hashFiles('contrib/depends/packages/*') }}
- name: depends sources cache
uses: actions/cache/restore@v3
with:
path: contrib/depends/sources
key: sources-${{ hashFiles('contrib/depends/packages/*') }}
- name: set apt conf
run: ${{env.APT_SET_CONF}}
- name: install dependencies
run: sudo apt update; sudo apt -y install guix git ca-certificates
- name: build
run: SUBSTITUTE_URLS='http://ci.guix.gnu.org' HOSTS="${{ matrix.toolchain.host }}" JOBS=2 ./contrib/guix/guix-build
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.toolchain.name }}
path: |
guix/guix-build-*/output/${{ matrix.toolchain.host }}/*