-
Notifications
You must be signed in to change notification settings - Fork 0
159 lines (134 loc) · 4.42 KB
/
continuous_integration.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
name: Dotfiles CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-latest]
include:
# Include Kali Linux using container
- os: ubuntu-latest
container: kalilinux/kali-rolling
name: kali-latest
# Include Gentoo using container
- os: ubuntu-latest
container: gentoo/stage3
name: gentoo-latest
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v4
# Kali-specific setup
- name: Setup Kali
if: matrix.container == 'kalilinux/kali-rolling'
run: |
apt-get update
apt-get install -y sudo git curl make gcc
# Gentoo-specific setup
- name: Setup Gentoo
if: matrix.container == 'gentoo/stage3'
run: |
# Configure news reading to avoid warnings
mkdir -p /etc/portage/profile
echo "news_pkg_install_unread = ignore" >> /etc/portage/make.conf
# Update portage and sync repository
emerge-webrsync
# Update system tools first
emerge --quiet-build=y sys-apps/portage
# Install required packages with correct Gentoo names
emerge --quiet-build=y \
dev-vcs/git \
app-shells/bash \
sys-devel/make \
sys-devel/gcc \
net-misc/curl \
app-misc/tmux
# Create necessary directories
mkdir -p /var/db/repos/gentoo
# Common setup for Ubuntu
- name: Install system dependencies (Ubuntu)
if: "!matrix.container"
run: |
sudo apt-get update
sudo apt-get install -y \
tmux \
curl \
git \
make \
gcc
- name: Install Bats
run: |
git clone https://github.com/bats-core/bats-core.git
cd bats-core
sudo ./install.sh /usr/local
cd ..
# Install Bats support libraries
git clone https://github.com/bats-core/bats-support.git test/test_helper/bats-support
git clone https://github.com/bats-core/bats-assert.git test/test_helper/bats-assert
- name: Install fzf
run: |
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install --all
- name: Install TPM (Tmux Plugin Manager)
run: |
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
- name: Install cht.sh
run: |
mkdir -p ~/.local/bin
curl https://cht.sh/:cht.sh > ~/.local/bin/cht.sh
chmod +x ~/.local/bin/cht.sh
- name: Download tmux completion
run: |
mkdir -p ~/.dotfiles
curl -o ~/.dotfiles/tmux.completion.bash \
"https://raw.githubusercontent.com/Bash-it/bash-it/master/completion/available/tmux.completion.bash"
- name: Install fzf-git
run: |
git clone --depth 1 https://github.com/junegunn/fzf-git.sh ~/.fzf-git
- name: Verify file structure
run: |
ls -la ~/.fzf
ls -la ~/.tmux/plugins/tpm
ls -la ~/.local/bin/cht.sh
ls -la ~/.dotfiles/tmux.completion.bash
ls -la ~/.fzf-git
- name: Run Bats tests
run: |
# Create test directories if they don't exist
mkdir -p test/test_helper
# Load bats helpers in test files
echo 'load "test_helper/bats-support/load"' > test/test_helper.bash
echo 'load "test_helper/bats-assert/load"' >> test/test_helper.bash
# Run tests
bats test/
- name: Run installation script
run: |
# Non-interactive mode for CI
export CI=true
./setup.sh all
- name: Verify dotfile symlinks
run: |
test -L ~/.bashrc
test -L ~/.bash_functions
test -L ~/.bash_aliases
test -L ~/.inputrc
test -L ~/.tmux.conf
test -L ~/.fzf.bash
test -L ~/.curlrc
- name: Test installed commands
run: |
tmux -V
~/.fzf/bin/fzf --version
~/.local/bin/cht.sh --help
#source ~/.fzf.bash && declare -F | grep -q fzf
- name: Check dotfile contents
run: |
for file in ~/.bashrc ~/.bash_aliases ~/.inputrc ~/.tmux.conf ~/.fzf.bash ~/.curlrc; do
echo "Checking $file..."
readlink -f "$file"
test -f "$(readlink -f "$file")"
done