-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (53 loc) · 1.62 KB
/
test-distros.yaml
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
name: Test Dotfiles on Different OS
on:
push:
branches: [ main ]
pull_request:
concurrency:
group: dotfiles-tests-${{ github.ref }}
cancel-in-progress: true
jobs:
dotfiles-test:
name: ${{ matrix.container }}-test
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
container: ["manjarolinux/base:latest", "archlinux:latest", "ubuntu:latest", "ubuntu:22.04"]
container:
image: ${{ matrix.container }}
env:
USER: dev
HOME: /home/dev
CHEZMOI_VERBOSE: 1
steps:
- name: Prepare environment
run: |
if command -v apt-get >/dev/null; then
if [ "$(id -u)" = "0" ]; then
apt-get update
apt-get install -y sudo git curl
else
sudo apt-get update
sudo apt-get install -y sudo git curl
fi
if ! command -v chezmoi >/dev/null; then
sh -c "$(curl -fsLS get.chezmoi.io)" -- -b /usr/local/bin
fi
elif command -v pacman >/dev/null; then
if ! command -v sudo >/dev/null; then
pacman -Syu --noconfirm sudo
fi
sudo pacman -Syu --noconfirm git chezmoi curl
else
exit 1
fi
sudo useradd -m dev || true
echo "dev ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/dev
- name: chezmoi init dotfiles
run: |
if command -v sudo >/dev/null; then
sudo -u dev chezmoi init --apply collieiscute -v
else
su dev -c 'chezmoi init --apply collieiscute -v'
fi