-
Notifications
You must be signed in to change notification settings - Fork 0
209 lines (177 loc) · 5.54 KB
/
ci.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
linux-desktop:
strategy:
fail-fast: false
matrix:
profile:
- personal
- work1
- work2
container:
- ubuntu:latest
- debian:latest
runs-on: ubuntu-latest
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v4
- name: Install prerequisites
run: apt-get update -q && apt-get install -y -q python3 python3-pip python3-venv curl git
- name: Setup PATH
run: echo "${HOME}/.local/bin" >> $GITHUB_PATH
- name: Cache Chezmoi external
uses: actions/cache@v4
with:
path: "~/.cache/chezmoi/external"
key: ${{ runner.os }}-${{ matrix.profile }}-${{ matrix.container }}-chezmoi-external
- name: Decrypt age key
env:
AGE_DECRYPT_PASS: ${{ secrets.AGE_DECRYPT_PASS }}
run: |
mkdir -p ${HOME}/.config/chezmoi
echo "${{ secrets.CHEZMOI_KEY }}" | base64 -d > ${HOME}/.config/chezmoi/key.txt
- name: Chezmoi init & apply
env:
DATA_profile: ${{ matrix.profile }}
IS_DESKTOP: "true"
run: |
git config --global --add safe.directory $(pwd)
./install.sh
- name: Assert
run: |
if ! grep -q "is_desktop: true" ${HOME}/.config/chezmoi/chezmoi.yaml; then
echo "::error file=chezmoi.yaml::is_desktop: true not found"
exit 1
fi
- name: Remove age key
if: always()
run: |
rm ${HOME}/.config/chezmoi/key.txt
linux-server:
strategy:
fail-fast: false
matrix:
profile:
- personal
- work1
container:
- ubuntu:latest
- debian:latest
runs-on: ubuntu-latest
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v4
- name: Install prerequisites
run: apt-get update -q && apt-get install -y -q python3 python3-pip curl
- name: Setup PATH
run: echo "${HOME}/.local/bin" >> $GITHUB_PATH
- name: Cache Chezmoi external
uses: actions/cache@v4
with:
path: "~/.cache/chezmoi/external"
key: ${{ runner.os }}-${{ matrix.profile }}-${{ matrix.container }}-chezmoi-external
- name: Chezmoi init & apply
env:
DATA_profile: ${{ matrix.profile }}
run: |
./install.sh
- name: Assert
run: |
if ! grep -q "is_server: true" ${HOME}/.config/chezmoi/chezmoi.yaml; then
echo "::error file=chezmoi.yaml::is_server: true not found"
exit 1
fi
linux-server-armv7:
strategy:
fail-fast: false
matrix:
profile:
- personal
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PATH
run: echo "${HOME}/.local/bin" >> $GITHUB_PATH
- name: Cache Chezmoi external
uses: actions/cache@v4
with:
path: "~/.cache/chezmoi/external"
key: ${{ runner.os }}-${{ matrix.profile }}-chezmoi-external
- name: Chezmoi init & apply
uses: pguyot/arm-runner-action@v2
env:
DATA_profile: ${{ matrix.profile }}
with:
# base_image: dietpi:rpi_armv7_bullseye
base_image: https://dietpi.com/downloads/images/DietPi_RPi-ARMv7-Bookworm.img.xz
cpu: cortex-a7
copy_artifact_path: results
# cpu: pxa250
commands: |
./install.sh
mkdir -p results
cp ${HOME}/.config/chezmoi/chezmoi.yaml results/chezmoi.yaml
chmod -R a+r results
- name: Assert
run: |
if ! grep -q "is_server: true" results/chezmoi.yaml; then
echo "::error file=chezmoi.yaml::is_server: true not found"
exit 1
fi
windows-desktop:
strategy:
fail-fast: false
matrix:
profile:
- personal
shell:
- pwsh
- pwsh-in-powershell
- powershell
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install prerequisites
shell: pwsh
run: |
# Install scoop to install winget & chezmoi
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
echo "$HOME\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# Install winget & chezmoi
scoop install winget
scoop install chezmoi
- name: Chezmoi init & apply - powershell
if: matrix.shell == 'powershell'
env:
DATA_profile: ${{ matrix.profile }}
CHEZMOI_PS1_COMMAND: powershell.exe
shell: powershell
run: |
echo "Running chezmoi init --apply"
chezmoi init --apply --source $Env:GITHUB_WORKSPACE
- name: Chezmoi init & apply - pwsh
if: matrix.shell == 'pwsh'
env:
DATA_profile: ${{ matrix.profile }}
CHEZMOI_PS1_COMMAND: pwsh.exe
shell: pwsh
run: |
echo "Running chezmoi init --apply"
chezmoi init --apply --source $Env:GITHUB_WORKSPACE
- name: Chezmoi init & apply - pwsh-in-powershell
if: matrix.shell == 'pwsh-in-powershell'
env:
DATA_profile: ${{ matrix.profile }}
CHEZMOI_PS1_COMMAND: pwsh.exe
shell: powershell
run: |
echo "Running chezmoi init --apply"
chezmoi init --apply --source $Env:GITHUB_WORKSPACE