Skip to content

Commit b47e490

Browse files
committed
Try Github actions for bootstrap test
1 parent 60053ec commit b47e490

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

.github/Dockerfile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM archlinux:base
2+
3+
RUN pacman -Syu --noconfirm \
4+
&& pacman -S --noconfirm fish yadm
5+
6+
WORKDIR /app
7+
COPY bootstrap.sh bootstrap.sh
8+
RUN chmod +x bootstrap.sh
9+
10+
CMD ./bootstrap.sh

.github/bootstrap.sh

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
echo "TEST: Cloning the dotfiles"
2+
yadm clone --no-bootstrap https://github.com/primeapple/dotfiles
3+
4+
echo "TEST: Checking if required directories and files exist"
5+
directories=("~/.config/nvim" "~/.config/fish")
6+
files=("~/.profile" "~/.vimrc")
7+
8+
for dir in "${directories[@]}"; do
9+
if [ ! -d "$dir" ]; then
10+
echo "Error: Directory $dir does not exist."
11+
exit 1
12+
fi
13+
done
14+
15+
for file in "${files[@]}"; do
16+
if [ ! -f "$file" ]; then
17+
echo "Error: File $file does not exist."
18+
exit 1
19+
fi
20+
done
21+
22+
echo "TEST: Executing bootstrap"
23+
yadm bootstrap

.github/workflows/bootstrap.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Bootstrap Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Build Docker image
17+
run: docker build -f .github/Dockerfile -t arch-bootstrap .github/
18+
19+
- name: Run bootstrap script
20+
run: docker run --rm arch-bootstrap

0 commit comments

Comments
 (0)