-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (105 loc) · 3.17 KB
/
ci.yml
File metadata and controls
126 lines (105 loc) · 3.17 KB
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
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- 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: 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- 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: 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
# windows-desktop:
# strategy:
# fail-fast: false
# matrix:
# profile:
# - personal
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v4
# - name: Install prerequisites
# shell: pwsh
# run: |
# # Install scoop to install winget
# iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
# echo "$HOME\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# # Install winget
# scoop install winget
# - name: Chezmoi init & apply
# env:
# DATA_profile: ${{ matrix.profile }}
# shell: powershell
# run: |
# (irm -useb https://get.chezmoi.io/ps1) | powershell -c -
# bin/chezmoi.exe init --apply --source $Env:GITHUB_WORKSPACE